Creating and applying an alpha mask.
Posted: 2009-05-07T08:38:22-07:00
Hi, I'm trying to programatically create and apply an alpha mask to an image. I can achieve this in GIMP but I have no idea how to achieve this in imagemagick. Can anyone help out.
Basically I'm doing this to work around a bug with Flash CS4 which fails to anti-alias png exports if you've certain specific features.
The process is as follow
From Flash I export a 24bit (no alpha) png with a white background - White.png
From Flash I export a 24bit (no alpha) png with a black background - Black.png
From Flash I export a 24bit (With alpha) png with a transparent background (Looks crap) - Broken.png
In GIMP I open White.png, add Black.png as a new layer with blending set to 'Difference Mode'
I flatten the image and save it as an alpha mask. - mask.png
I then open Broken.png - remove the alpha, and add mask.png as a new alpha mask.
The results are then perfect.
Could someone point me in the right direction to get started making this work with ImageMagick.
Basically I'm doing this to work around a bug with Flash CS4 which fails to anti-alias png exports if you've certain specific features.
The process is as follow
From Flash I export a 24bit (no alpha) png with a white background - White.png
From Flash I export a 24bit (no alpha) png with a black background - Black.png
From Flash I export a 24bit (With alpha) png with a transparent background (Looks crap) - Broken.png
In GIMP I open White.png, add Black.png as a new layer with blending set to 'Difference Mode'
I flatten the image and save it as an alpha mask. - mask.png
I then open Broken.png - remove the alpha, and add mask.png as a new alpha mask.
The results are then perfect.
Could someone point me in the right direction to get started making this work with ImageMagick.