GIMP Wallpaper: make desktop backgrounds with GIMP

Selection to Wallpaper makes it easy to adapt one image to wallpaper for one or more different screen sizes: starting with a selection of appropriate aspect ratio, it copies the image, crops, scales and sets the image filename so you can save to the right place. Edit the script to put in the screen sizes you use and the base directory where you want to save it, and make tool presets for the rect selection tool so you don't have to type in the aspect ratios every time.

0.5 is updated for GIMP 2.8, which has a new concept of image names (fixes a bug where it would want to save as "Untitled").


Save it to ~/.gimp-2.8/plug-ins (adjust as needed for your GIMP version), and if you're on Linux or Mac, make sure it's executable (e.g. chmod +x ~/.gimp-2.8/plug-ins/

Make a directory called ~/Images/Backgrounds with subdirectories for the X resolution. So if you have a monitor at home that's 1680x1050 and a laptop that's 1024x768, you'd want directories ~/Images/Backgrounds/1680 and ~/Images/Backgrounds/1024. You have to create these directories; the plug-in won't do it for you.

[GIMP toolbox presets] Fire up GIMP, load your image, choose the rectangular selection tool, and set its tool options to the proper Fixed: Aspect ratio for your monitor (e.g. 1680:1050, or 4:3, or whatever).

Select the area you want. (View->Snap to Canvas Edges is quite useful here.)

When you're happy with the selection, Image->Selection to Wallpaper will crop to the selected rectangle, figure out what size you want based on the aspect ratio, scale to that size, and pop up a dialog letting you confirm the resolution, save directory and filename before finally saving the new wallpaper.

Customize your sizes

The script comes ready to use the three sizes I use myself: 1680x1050, 1366x768 and 1024x768. It has a few other entries commented out. If you want resolutions other than this, edit the script for your own needs. I didn't want to have GIMP ask every time -- that would be one more dialog for every background you make.

However, a Warning: you can't have more than one of 1600x1200, 1024x768 and 800x600. Those sizes all have the same aspect ratio (4:3) and the script wouldn't be able to tell which one you mean. If you need more than one of those sizes, I'd suggest setting the script to 1600x1200, then create the smaller ones from that (no cropping needed, just scaling).

GIMP tool presets

This is all made a lot easier by GIMP tool presets. If you need to use the same aspect ratio repeatedly -- for instance, you frequently want to make wallpaper for several different monitors and you get tired of typing or remembering numbers like 1680 or 1366 -- you can tell GIMP to remember it for you.

Set a fixed aspect ratio, then click on the Save presets button (hiding behind the popup menu in the image at right). GIMP will prompt you to enter a name for this setting. Once you've named it, you can choose it by clicking on the Restore from preset button.

Warning: the Save preset and Restore from preset buttons look very similar and it's easy to confuse them. Once you have saved a preset, it will appear in a popup menu on the Save button that looks just like the one on the Restore button. If you mistakenly choose an entry in Save instead of Restore, you will overwrite your saved setting. I've lost count of the number of times I've done this. If you don't remember for sure, which button is which, always hover over them first and make sure.

(And no, I'm sorry to say, these details aren't in my GIMP book, Beginning GIMP. I only started using this technique much after the second edition went to press.)

Some details about how this came to be written are on my blog:

More software
Shallow Sky Home