The free world is the new continent in cyberspace that we have built so we can live here in freedom. It's impossible to live in freedom in the old world of cyberspace, where every program has its feudal lord that bullies and mistreats the users. So, to live in freedom we have to build a new continent. Because this is a virtual continent, it has room for everyone, and there are no immigration restrictions. - Richard Stallman -

picking image randomly from specified paths;
skipping too small images and images with too different aspect rate;
rescaling it in a clever ways (crop solid margins, resize with cubic, then liquid rescale algorithm) to fit the desktop with as little quality loss as possible;
labelling images (that is, rendering the label in the corner) using embedded tags;
daemonizing to pick new image on a time-basis or when triggered (by SIGHUP or cli);
keeping track of used images, blacklisting.

Intended usage is to point it to the path(s) with random image collection(s) and let it adjust any suitable ones to the current screen size. It has no gui and no capabilities to dowload images from anywhere.

Quick links

How it works

Main process is actually very simple, to the extent that it's written in bash (which has negligible memory footprint), but the main magic is in the image processing part.

All the wallpaper-setters I've seen doesn't seem to consider this part important enough, focusing instead on providing GUI and image fetching mechanisms, but if you have a local collection and don't need guis, they're usually not much better than feh or ten-liner python script.

To see what I mean, let's take a simple case of a laptop screen (1366x768) and an image (960x660):

As you can see, image and screen aspect ratios don't match and the screen resolution is totally different (larger).

What all setters seem to do is either resize the image, crop it, or a combination of these.

Results, in this case, as you can probably guess, are not particulary good:

Each of the above has obvious flaws - it's either cropped, scaled in a weird way and/or has solid margins.

What this tool produces (automatically, from any random image, without any interaction), is this:

Click the images to see detailed versions, and note that details and their proportions are magically preserved by the grace of liblqr (liquid rescale implementation).

To see all the intermediate steps in more detail, let's get back to image one:

Obviously, image can be at least cropped out of solid margins (yet none of existing tools seem to care), but if you'll load it into GIMP and use autocrop, it won't really change anything, because (surprise!) margins are not solid at all: they usually have the noise or some minor texture, as a matter of fact, so you'd have to do the fuzzy-solid cropping, at least.

And the tool does that, no problem. Actual technique I've used was to create a simple mask-layer, adjust it's contrast and use solid-crop feature to determine the cropped margins, then just use the same values on the original layer.

It certainly is better, but still in no way fits nicely to 16:9 screen with larger resolution, and this is the point where LQR (liquid resizing aka seam carving) algorithm comes into play.

LQR drops/scales the most featureless parts of an image, so all the important parts could be left untouched.

I highly recommend to spend a minute or two to skim over this YouTube video, showing what the algorithm is capable of and explaining how it does that. You'll probably never look at the usual Cubic and Sinc the same way again ;)

As you can see, black leftovers at the bottom magically disappeared, leaving the original label intact, which is a superior result than can be produced with simple matrix interpolations.

Since most of my images come from the sites like DeviantArt (I actually aggregate interesting (to me) channels from there to this feed), which make it easy to track authors, most time when I see really cool artwork, I like to know who made it and if there's more of such awesomeness (and there usually is!).

So a filename is a nice thing to see, at least. Author name could be there, you can maybe look up an image by it, if it really corresponds to image title in an obvious way.

But most images also come with an embedded tags, like EXIF or XMP, and all the info like author and title is there in the sane state, so these are used in the label if present in a file, overriding filename/mtime defaults:

Note that label color is a bit of PITA and not quite easy to get right reliably.

Tool calculates label size, takes the average color in the area where it'll be rendered and picks the most different (Delta E, CIEDE2000 algorithm) color from the predefined set of a brightest ones.

Produced image is stored to "/tmp/.lqr_wpset_bg.*.png" (can be changed in lqr_wpset head) and then set as a background using either python gconf interface (for gnome), xfconf (xfce) via dbus interface or just by drawing it to an X root window via pygtk. To set background on modern KDE, use scripted image wallpaper plugin with a simple shell script, containing just "echo /tmp/.lqr_wpset_bg.*.png" line (note no quotes, so shell will expand the asterisk).

So far, results don't make me flinch in disgust at horribly-mangled images, but if there's a room for improvement, guess I'll spot it over time, and will certainly appreciate any suggestions, since I don't really work with graphics at all, and may not know even some basic concepts every artist and designer are probably aware of.

Installation

While "aura" script is pure bash, all image manipulations are performed from a python script ("lqr_wpset.py") using gimp's python-fu.

colormath python module - to pick the most contrast color for label using CIEDE2000 (simplier algorithm will be used otherwise).

These are probably best to get using the package manager, but colormath can be installed with a simple "easy_install colormath" or "pip colormath" command.

Project files can be downloaded from this page, just one latest .tar.gz will do. Tarball can be extracted with regular double-click from some GUI (like GNOME Nautilus shell, KDE Dolphin, XFCE Thunar, etc), tapping enter on it inside midnight commander or typing "tar xf /path/to/aura-X.Y.tar.gz" in some shell. Inside there are two files beside the ubiquitous "README" - "lqr_wpset.py" and "aura".

Actual "installation" is needed for the gimp plugin (lqr_wpset.py), which should be put into one of gimp plugin directories, like "~/.gimp-2.6/plug-ins/" (other option is usually "/usr/lib/gimp/2.0/plug-ins", but your mileage may vary across distros, read the docs here or there if in doubt) and be marked as executable. Here's what I mean: