Re: Compositing transparent png over image using Magick++ GraphicsMagick API
Dragan Jotanovic <[email protected]> Tue, 28 Jan 2014 19:33:07 +0000
| Newsgroups | gmane.comp.video.graphicsmagick.apis |
|---|---|
| Message-ID | <CAJSsW4oeLZsgxrMnJ6_7Dq1_S++9P-Wor37++OiG_onhrGb43g@mail.gmail.com> |
Thanks for the quick response. I'm not trying to create transparent jpeg, I'm trying to compose transparent png onto an image, so that only non-transparent pixels are composed. For example, when I execute this from command line: gm compose watermark.png source.jpg destination.jpg I get the desired effect. Only non-transparent pixels from png image are composed to destination image. What I'm interested in is how to achive this with magick++ api? Should I create an empty image with type TrueColorMatteType first and than compose both source and watermark images on that image instead of composing directly to source image? Dragan On Tue, Jan 28, 2014 at 7:11 PM, <[email protected]> wrote: > The JPEG format does not support transparency. Try saving as png instead. > > > On Tuesday, 28 January 2014, Dragan Jotanovic <[email protected]> wrote: > >> Hello, >> >> I am trying to compose png watermark with transparency using Magick++ >> API, but after saving, image the transparency is lost. >> >> The code I use is: >> >> Image source("source.jpg");Image watermark("watermark.png"); >> source.composite(watermark, 0, 0, DissolveCompositeOp); >> source.write("destination.jpg"); >> >> I tried explicitly setting image type (of both source and watermark) to >> TrueColorMatteType, but no change, transparent color is still black >> instead of transparent. >> >> Does anyone know what else needs to be done in order to preserve >> transparency after composition? >> >> >> Dragan >> > > > ------------------------------------------------------------------------------ > WatchGuard Dimension instantly turns raw network data into actionable > security intelligence. It gives you real-time visual feedback on key > security issues and trends. Skip the complicated setup - simply import > a virtual appliance and go from zero to informed in seconds. > > http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk > _______________________________________________ > Graphicsmagick-apis mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/graphicsmagick-apis > > ------------------------------------------------------------------------------ WatchGuard Dimension instantly turns raw network data into actionable security intelligence. It gives you real-time visual feedback on key security issues and trends. Skip the complicated setup - simply import a virtual appliance and go from zero to informed in seconds. http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk _______________________________________________ Graphicsmagick-apis mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/graphicsmagick-apis