Page 1 of 1

Split RGB+alpha and compose back

Posted: 2014-04-04T13:14:57-07:00
by soulburner
I'm getting a little crazy here...

I want to do simple thing.

1. split my transparent PNG into 2 images - RGB + grayscale alpha
(do something)
2. compose them back

So, for now I don't do anything between steps 1 and 2, but it doesn't work.

My code is:

Code: Select all

convert in.png -channel Alpha -separate a.png
convert in.png -channel alpha -threshold 100%% +channel rgb.bmp
This part is ok. I get RGB without transparancy and alpha channel as a grayscale image.

But when I try to combine them back, I loose all my semi-transparent pixels:

Code: Select all

convert rgb.bmp a.png -alpha off -compose CopyOpacity -composite PNG32:result.png

Re: Split RGB+alpha and compose back

Posted: 2014-04-04T13:37:47-07:00
by snibgo
It works fine for me, with IM 6.8.8-7 on Windows 8.1. What version and platform are you on?

Re: Split RGB+alpha and compose back

Posted: 2014-04-05T02:19:17-07:00
by soulburner
Ahhh.... I've just updated imagemagick and it works fine now... Thank you :)