Plugin is created as a part of an aura project.
Plugin takes a single argument - path of an image file - and then performs the following actions:
Result of these manipulations is a perfectly fitted and labelled desktop background with as little quality loss as possible.
Examples:
Note that even though images are enlarged and scaled to different aspect, all the image features are preserved from distortion, which occurs in uniformly-colored and (relatively) featureless areas instead.
Requirements:
Optional (good to have, but will work without these) stuff:
Having the required packages available in the system, just put the plugin into one of the gimp plugin directories (like "~/.gimp-2.8/plug-ins/") and set executable bit on it ("chmod +x ~/.gimp-2.8/plug-ins/lqr_wpset.py").
Since techniques, used to determine desktop size and set background is specific to X window system, setting background will not work on windows, but python code can be easily adjusted to use static values and just save the resulting image. I don't have a windows machine to make/test these changes though.
To use the plugin from already-started GIMP instance, use "Filters -> Python-Fu -> LQRify to desktop" menu option.
Non-interactive invocation example:
gimp -ib '(python-fu-lqr-wpset RUN-NONINTERACTIVE "image.jpg") (gimp-quit TRUE)'
(where "image.jpg" is a path to image to use as a background)
Various customization is also possible (although in most cases it should not be necessary) by editing variables, set in the beginning of the script:
max_aspect_diff = 0.7 # 16/9 - 4/3 = 0.444
max_smaller_diff = 3 # don't process images N times smaller by area (w*h)
min_prescale_diff = 0.3 # use cubic on larger images (preserving aspect), then lqr
label_offset = 10, 10
label_colors = [0]*3, [255]*3, (255, 0, 0),\
(0, 255, 0), (0, 0, 255), (255, 255, 0), (0, 255, 255) # most contrast one will be chosen
font_filename = 'URW Palladio L Medium', 16
font_timestamp = 'URW Palladio L Medium', 11
# Asterisk will be replaced by temporary id for created images
# All files matching the pattern will be a subject to cleanup!
result_path = '/tmp/.lqr_wpset_bg.*.png'
Artworks on this page ("D I E" and "AIR IN KYOTO" by Kai Lim) are subject to a copyright and used with author's permission.
Plugin code is released under a permissive WTFPL license, feel free to hack and reuse it as you see fit.
Attachment | Size |
---|---|
lqr_wpset-0.14.py.txt | 16.33 KB |
Comments
Can't get it to work
After installing the plugin in the Gimp plugin directory without .txt and making it executable I cant find it in the Python menu (also not being greyed out).
I am using Ubuntu 10.04, Gimp 2.6.8 , python 2.6.5 v python-gtk2 v2.17 and a working Carlo Baldassi liquid rescale plugin.
Please advice
Problematic error
Tried the plugin. It installed well but when I wanted to use it, there came two error messages (dont know anymore what it was ) After that LQRify doesnt work anymore and stays grayed out in the menu, even after reinstalling the plug in. How to restore this?
It seem to be grayed-out when
It seem to be grayed-out when no image is opened in GIMP, I haven't looked much into an interactive-invocation interface, but I probably will, shouldn't be hard to make it just set current image.
Try using it from the terminal in the meantime - at least it should give you descriptive and copy-paste'able error messages right there.