Image Magick compositing with alpha channel in background
Posted: 2013-02-11T20:19:38-07:00
Hey there; I'm a bit new, so I hope I'm asking this the right way:
I'm trying to create a fundraising thermometer that fills up with hearts; let's say we've raised 50%; the bottom half should show empty hearts--the top half full hearts. There is about a 20 pixel fade between the two.
I have 3 PNG's
1 shows empty hearts with a transparent background
1 shows full hearts with a transparent background
1 is a gradient with no transparency that is automatically generated and controls where the fade happens on the thermometer.
The problem:
I can get it to work, but I lose the transparency on the background image.
OR I can preserve the transparency, but instead of a fade from full to empty, I just get a solid cut-off.
My 3 PNGs can be seen here:
http://wskg.org/pledgeimage/outline.png
http://wskg.org/pledgeimage/full.png
http://www.wskg.org/pledgeimage/overlap_mask.png
I should add that i've been putting all 3 of these on top of another transparent PNG called bg.png and I've been using the following:
convert -background transparent -extent 172x420 pledgeimage/bg.png pledgeimage/outline.png pledgeimage/overlap_mask.png -composite pledgeimage/full.png pledgeimage/overlap_mask2.png -gravity East -composite pledgeimage/current_pledge.png
Can somebody point me in the right direction?
Thanks!
Joshua
I'm trying to create a fundraising thermometer that fills up with hearts; let's say we've raised 50%; the bottom half should show empty hearts--the top half full hearts. There is about a 20 pixel fade between the two.
I have 3 PNG's
1 shows empty hearts with a transparent background
1 shows full hearts with a transparent background
1 is a gradient with no transparency that is automatically generated and controls where the fade happens on the thermometer.
The problem:
I can get it to work, but I lose the transparency on the background image.
OR I can preserve the transparency, but instead of a fade from full to empty, I just get a solid cut-off.
My 3 PNGs can be seen here:
http://wskg.org/pledgeimage/outline.png
http://wskg.org/pledgeimage/full.png
http://www.wskg.org/pledgeimage/overlap_mask.png
I should add that i've been putting all 3 of these on top of another transparent PNG called bg.png and I've been using the following:
convert -background transparent -extent 172x420 pledgeimage/bg.png pledgeimage/outline.png pledgeimage/overlap_mask.png -composite pledgeimage/full.png pledgeimage/overlap_mask2.png -gravity East -composite pledgeimage/current_pledge.png
Can somebody point me in the right direction?
Thanks!
Joshua