displaying wallpaper (display -backdrop ...) problem

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
archguest

displaying wallpaper (display -backdrop ...) problem

Post by archguest »

I am trying to use display from ImageMagick 6.6.2-10 on Arch linux to show this image from Arch linux in the centre of my desktop. I run it with:

Code: Select all

display -backdrop -background '#3f3f3f' -flatten -window root Downloads/archlinux-logo-light-90dpi.png
I get the image displayed in the centre of my root window (desktop) but my -background option is ignored for both within and outside of the image. Within the image I get white in place of transparency 'checkboard' and outside I get black.

I read the documentation for display and I can't figure out what is wrong.

What I would like to achieve is to display this image in the centre of my root window, on the background colour #3f3f3f with transparent parts of the image being transparent that is being #3f3f3f. Please help.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: displaying wallpaper (display -backdrop ...) problem

Post by fmw42 »

This works with color names, but does not work with hex or rgb colors on my Mac OSX Tiger IM 6.6.3.1 Q16

display -background gray -backdrop <image>

You could report this to Developers or Bugs and ask about non-color name representations of colors in display.
archguest

Re: displaying wallpaper (display -backdrop ...) problem

Post by archguest »

fmw42 wrote:...
Thanks for the hint! Actually, the colour representation worked this time because I tried a different order of arguments! How weird is that?

This arrangement of arguments ignores -background option and gives white background for transparent parts:

Code: Select all

display -backdrop -background '#3f3f3f' -flatten -window root Downloads/archlinux-logo-light-90dpi.png
This gives the correct background #3f3f3f for transparent parts:

Code: Select all

display -flatten -backdrop -window root -background '#3f3f3f' Downloads/archlinux-logo-light-90dpi.png
Imagemagick command line options page does not mention that order of arguments is important and neither does the manual for display.

Do you think it is a bug?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: displaying wallpaper (display -backdrop ...) problem

Post by fmw42 »

Is flatten really necessary?

This works just fine for me:


display -background gray -backdrop logo2t.png


as does this

display -background '#3f3f3f' -backdrop logo2t.png


If you really want to use -flatten, then this is where it should be:

display -background '#3f3f3f' -flatten -backdrop logo2t.png

But it is no different from leaving it off.

I am on mac osx tiger, IM 6.6.3.1 Q16

Order is important as you have to tell -backdrop what color you want prior to invoking -backdrop. IM is like that with respect to settings before options. see http://www.imagemagick.org/Usage/basics/#why
Post Reply