Backtestground

Backtestground is a project collecting a few tools to aid in designing wallpapers.

GIMP XCF and Inkscape SVG templates

Both have a 2560 x 1600 pixel canvas to use the largest commonly offered resolution, currently. Passepartout layers allow to see how things will look when this space is cropped to conform to other common aspect ratios.

This simulates the effect the Style: Zoom setting in Appearance Preferences: Background will have: the image is scaled up or down such that it fills the screen without distorting it. If the aspect ratio of the image is wider than that of the screen, it will be scaled to the same height and the areas on the side will be cropped. If the aspect ratio of the image is taller than that of the screen, it will be scaled to the same width and the areas on top and bottom will be cropped.

For Ubuntu and Gnome users: Putting them into your Templates folder makes them available in Nautilus or on the desktop by right-click, Create Document.

The Inkscape SVG file supports batch export to 14 screen resolutions.

Howto:

  • Bring up the Layers panel (Keyboard shortcut: Shift-Ctrl-L)
  • lock all but the targets layer
  • Select all in the targets layer (Ctrl-A)
  • Bring up the Export Bitmap dialog (Shift-Ctrl-E)
  • Check Batch export 14 selected objects
  • Hit Export

This will create 14 files with names like size_1024x0768.png in the same folder as the opened file. The size_ part is an easy target for a search-and-replace on the SVG file, if you want a specific prefix or target path.

You might want to remove the rectangles in the targets layer matching unwanted resolutions. Repeatedly Alt-clicking allows to cycle through stacked objects in Inkscape (your window manager might be configured to intercept Alt-clicks, though).

bgce – Background Context Extractor

bgce command-line tool (Python script). Put it in /usr/local/bin and make sure permissions allow execution.

Expects two screenshots as input:

  • with white desktop background
  • with shadow-color (usually black) desktop background

It creates a PNG image with transparent desktop.

This is useful for evaluating wallpapers that should go well with panels and themes other than the one you are currently using.

Usage:

  • bgce on_white.png on_shadow.png will create a context.png in the working directory.
  • bgce on_white.png on_shadow.png -o some-existing-dir will create context context.png within some-existing-dir
  • bgce on_white.png on_shadow.png -o custom.png will create custom.png instead of context.png
  • bgce on_white.png on_shadow.png -o custom will create custom.png (given that custom is not a directory).

What still needs to be solved: creating such context images for several resolutions without lots of manual work. Maybe some kind of slicing script, taking several separate images and/or some coordinates as input.

sizes

sizes command-line tool (Python script). Put it in /usr/local/bin and make sure permissions allow execution.

Expects an image as input and crops/resizes it to 14 screen resolutions (except the one the image conforms to, if any).

Usage:

  • sizes input.png creates 13 or 14 files with names like 1024x0768.png.
  • sizes input.png -o some-existing-dir will create the files in some-existing-dir.

Currently you have to edit the definition of resolutions in line 50, if you want fewer or different resolutions.

Packaging

Developing these has been fun and straightforward thanks to Python and the Imaging and argparse libraries. Until I looked into installation and packaging. Ran into some interesting issues with setuptools, where I would end up with generated scripts in /usr/local/lib, that would fail because the modules were not in /usr/lib/python2.6/dist-packages/ but
/usr/local/lib/python2.6/dist-packages/. No issue if I just don’t use entry_points. I managed to build a deb after wading trough horrifying amounts of documentation, but I did not manage to build a source deb that I can upload to my PPA. The process fails silently, Launchpad doesn’t tell me what’s wrong. Known issue, filed a support request.

The template files should end up in the users’s Templates folder. Doable with setup.py, even if discouraged. Not possible from a package.

I realise huge amounts of thought and hard work went into all the infrastructure and documentation, so I don’t want to complain too much. But this is why I simply link to a few files that can be used as they are, actually, for now.


Flattr this

About these ads

About thorwil
I'm a designer from Germany. My main interests are visual and interaction design, free/open-source software and (electronic) music.

3 Responses to Backtestground

  1. leogg says:

    This is *really* nice!
    Thanks for the scripts! :)

  2. Sean Sutton says:

    I have been using GIMP for a while now, these scripts will come in very handy. Many thanks!

  3. MarkC says:

    The Inkscape issue with ALT-clicks being captured by the window manager (usually for dragging the window around the desktop) can often be avoided by pressing and holding the “Windows” key first, then holding ALT, and then clicking (while still holding both keys).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: