[GM-help] png, transparency and composite
Swiss army knife of image processing
Brought to you by:
bfriesen
From: florian i. <flo...@vi...> - 2008-04-21 10:01:28
|
Hello everybody, using Magick++ library, i'm trying to merge two png images, one of them has a transparency channel. I want to apply a global transparency value to this image before the composite operation. Here is an extract of my code : Magick::Image blankImage( "/home/firagne/checker.png" ); if(prepareLogo("/tmp/logoPreview.png", PREVIEW_XSIZE, PREVIEW_YSIZE)){ Magick::Image logoPreview( "/tmp/logoPreview.png" ); logoPreview.opacity( transparency * TransparentOpacity / 100 ); blankImage.composite( logoPreview, xpad, ypad, Magick::OverCompositeOp ); } It works perfectly if the logoPreview source has no transparency channel, and don't work if it has one, meaning that on the composite image, transparency is applied to the transparent channel and not to the global image. The same result is observed if i use gif, and does not occur using jpeg, since jpeg doesn't handle transparency, as far as i know. I'm probably doing something wrong but don't see what. Any help will be more than welcome! thanks Florian |