Hello all.
I have the following situation.
Background image is transparent PNG image.
Image its self in JPG format.
Mask in PNG format.
I try to do a composite.
convert background.png image.jpg mask.png -composite result.png
But I lose semi-transparency this way.
If I use white background there is no problem.
Could you please advise, how I can save semi-trasparent pixels when composite ?
semi-transparent pixels
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: semi-transparent pixels
Post your source images as well as the mask.
Generally the background and overlay (first and second) images are not transparent. You may want to review
http://www.imagemagick.org/Usage/compose/
and
http://www.imagemagick.org/Usage/channels/#masks
Generally the background and overlay (first and second) images are not transparent. You may want to review
http://www.imagemagick.org/Usage/compose/
and
http://www.imagemagick.org/Usage/channels/#masks
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: semi-transparent pixels
I believe you have a very old ImageMagick. The 3 image masked composition was a boolean or binary up until Im version 6.3.4-11.
But there are lots of ways to skin that cat!
One alternative is to take the first image, and use the mask to shape that image before overlaying it on your background.
Examples of this is
http://imagemagick.org/Usage/compose/#copyopacity
http://imagemagick.org/Usage/fonts/#mask
http://imagemagick.org/Usage/channels/#masks
Especially the example immediateally before that last.
Another method is to directly use the mask (probably negated) to just make the areas you want white white, by using a 'screen' composition. More on this is..
http://imagemagick.org/Usage/compose/#screen
http://imagemagick.org/Usage/channels/#compose
But there are lots of ways to skin that cat!
One alternative is to take the first image, and use the mask to shape that image before overlaying it on your background.
Examples of this is
http://imagemagick.org/Usage/compose/#copyopacity
http://imagemagick.org/Usage/fonts/#mask
http://imagemagick.org/Usage/channels/#masks
Especially the example immediateally before that last.
Another method is to directly use the mask (probably negated) to just make the areas you want white white, by using a 'screen' composition. More on this is..
http://imagemagick.org/Usage/compose/#screen
http://imagemagick.org/Usage/channels/#compose
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/