Page 1 of 1

something changed in 6.? -combine rgba png

Posted: 2014-09-05T03:32:18-07:00
by olilarkin
I am trying to resurrect an old script i had which rendered GUI elements using povray, involving some imagemagick trickery to facilitate alpha transparency with shadows. One stage of my imagemagick stuff is producing different results (since some change in v6 a couple of years ago) and i can't work out why. It looks inverted, but i tried a -negate and the end result is not right.

wrong:
Image
right:
Image

here is the command i am using to combine four .pngs

Code: Select all

convert -depth 8 -channel RGBA -combine r.png g.png b.png a.png out.png
i've uploaded the new and old files here:

http://www-users.york.ac.uk/~ol507/imgmagick/

I'd appreciate any help with this, i've tried all sorts

thanks,

Oli


here are the old scripts:
http://olilarkin.blogspot.co.uk/2011/03 ... knobs.html
https://github.com/olilarkin/guiutiliti ... /render.py

Re: something changed in 6.? -combine rgba png

Posted: 2014-09-05T05:23:48-07:00
by snibgo
The order is wrong. "-combine" should come after the input files. Try:

Code: Select all

convert -depth 8 -channel RGBA r.png g.png b.png a.png -combine out.png
In modern IM, alpha channel has meanings 0=transparent, 1=opaque. If your input image is the wrong way round, you can negate it:

Code: Select all

convert -depth 8 -channel RGBA r.png g.png b.png ( a.png -negate ) -combine out.png

Re: something changed in 6.? -combine rgba png

Posted: 2014-09-05T18:11:23-07:00
by olilarkin

Re: something changed in 6.? -combine rgba png

Posted: 2014-09-05T23:03:15-07:00
by snibgo
Good stuff. The parentheses ( and ) are generally important; they restrict the action to the images within the parentheses. In this case, they restrict "-negate" to .png.