Erik Karlsson on  wrote...
| Anthony Thyssen wrote:
| > | But when trying to overlay it on the target
| > | > $image->Composite(image => $wimage,
| > | > compose => "Over",
| > | > opacity => int($opacity * (2 ** $wimage->Get('depth'))));
| > | the "transparent" background is instead black, but the opacity is in
| > | effect on that black background.
| > | 
| > | Without opacity, the transparent background is transparent as it should.
| > | 
| > The "Over" option I do not believe is needed for most compositions, but
| > is used for some special cases.
| >
| > What are you trying to achieve by setting it?
| >
| >   
| I just want to overlay whatever transparent picture on another picture,
| preserving the transparency but increase the opacity of the
| non-transparent areas.
| I was under the impression "Over" would preserver transparency and it
| does, so long as I don't try to increase the opacity.
| 
| What type of compose-method should I use for this end?
| 
You could try using the  Dissolve method  which gives you direct control
adjustments for the opacity of the images before thay are 'over'
composed.

The Blend method however uses an 'add' composition after the opacity
adjustments are made.

Command line examples of these are at
   http://imagemagick.org/Usage/compose/#dissolve

A am not certain how it translates to PerlMagick, but I do know it is
available.

 From the comamnd line would use something like...

   -dissolve  200x100

To make the source image twice (200%) as opaque as before.
This is different to just a  -dissolve  200  which
is equivelent to  200x0  and not  200x100

Note this is a direct multiplication of the alpha channel values,
If this is not what is wanted you will need to use something like
-evaluate to adjsut it the way you want first.
   http://imagemagick.org/Usage/transforms/#evaluate



  Anthony Thyssen ( System Programmer )    <[EMAIL PROTECTED]>
 -----------------------------------------------------------------------------
   Grok (vb) :- To drink in all the knowledge. To understand so thoroughly
   it becomes a part of your whole.  [ From the martian meaning: To Drink ]
                       -- Robert A. Heinlein   "Stranger in a Strange Land"
 -----------------------------------------------------------------------------
     Anthony's Home is his Castle     http://www.cit.gu.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to