Sign in Translate Vladstudio English

Blog 

Updated bash script for resizing and saving wallpapers using Ubuntu and ImageMagick

{5 July 2012}

Some time ago, I published my method of saving a wallpaper in multiple sizes, using "bash" scripting language. Please read the original post here and more recent discussion here.

Recently, I revised my bash script, and I wanted to share the updated code with you. Maybe you will find it useful. It has comments inside, however, to fully understand what is going on, you will want to learn a bit about bash.

I removed actual file and folder names, you will need to replace empty variables with actual values. Also, this script does a lot of things you will probably won't need, but I leave them as is, in case you're curious (feel free to modify it to your needs and remove all unnecessary parts).

I use this script with Ubuntu, it may well work on other systems, but I did not test. Requirements:

As seen in the code, the source files I use are:

Tweak those to your liking.

View the code here: https://github.com/vladstudio/bash-resizing-wallpapers (direct download).

← From email conversation: creating a wallpaper site that does not suck "Who Stole The Moon?" - now for iPhone! →

Comments {8}

Vita 5 July 2012
Hi Vlad, I quickly read through the script and I think the penultimate line should be "rm -rf ${temp}" instead of "rm -rf temp". Thanks for sharing this, it must have taken a lot of work to put together.

Vlad Gerasimov 10 July 2012
Robert - great idea! I added a repo to Github, and updated the link in the post. Thanks!

László Pokorádi 13 July 2012
Hi Vlad, Is it possible to generate 720*1280 mobile wallpapers with this script? I can not see this resolution in this script. Regards, Laszlo

Tobias Herkula 3 August 2012
We often use "read all mails really fast" as a joke term for "rm -rf *" at work...

Vlad Gerasimov 5 July 2012
Vita - whoooops! Thanks so much, I fixed the code. Always be careful with rm -rf! Hehe.

Robert Holak 10 July 2012
That's a nice script setup. Have you considered putting it up on something like GitHub? Then, people like Vita or anyone else that finds a boo-boo can submit a fix that you can look at and incorporate. I love your design work and since the lifetime account was such a great deal I think many users would be happy to help with things like this to make the grunt part of your work easier :)

Vlad Gerasimov 14 July 2012
László Pokorádi - I assume you have an Android phone with 720x1280 screen, correct? Then you need 1440x1280 picture (which I have), not 720x1280. People ask a lot about this, and I am not sure what is the best way to indicate that Android users need twice wider image... Any ideas? :-)

试试 18 August 2012
表情

Add comment

1 2 3 4 5 6