something changed in 6.? -combine rgba png

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
olilarkin
Posts: 2
Joined: 2014-09-05T03:04:17-07:00
Authentication code: 6789

something changed in 6.? -combine rgba png

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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
snibgo's IM pages: im.snibgo.com
olilarkin
Posts: 2
Joined: 2014-09-05T03:04:17-07:00
Authentication code: 6789

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

Post by olilarkin »

snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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.
snibgo's IM pages: im.snibgo.com
Post Reply