List Info

Thread: Magick++ help emulating composite -dissolve NN




Magick++ help emulating composite -dissolve NN
user name
2006-02-23 14:37:21
I'm fairly new to using the Magic++ library, though I've
been using 
ImageMagick on the command line for some time. 
I'm trying to emulate the following command line in c++:

convert logo.gif  -fill grey50 -colorize 40  miff:- |\
    composite -dissolve 30 -  in.gif out.gif

I have tried quite a few ways to make this work, but it
seems that I 
cannot apply an alpha channel to the logo.gif image before
compositing 
it, I've tried saving to Blobs in other formats etc. but to
no avail.

The section of my code looks something like this:

---%<---
Image Logo;
Logo.read(logo.gif);
Logo.colorize(40,"grey50");
Logo.type(TrueColorMatteType);  //doesn't seem to have any
effect
Logo.matte( true );             // ditto
Logo.opacity(MaxRGB*30/100);    // ditto

Image image;
image.read("in.gif")
image.composite(Logo,CenterGravity,DissolveCompositeOp);
image.write("out.gif");
---%<---

I believe I need to make the logo image have an alpha
channel and then 
set it to 30 % of MaxRGB (the 30 argument to the dissolve
option in the 
command line case but I can't seem to get this to work.

Any tips?

Thanks,
Mike

-- 
http:/
/www.sve.man.ac.uk/General/Staff/jonesM/
_______________________________________________
Magick-users mailing list
Magick-usersimagemagick.org
http://studio.imagemagick.org/mailman/listinfo/magick
-users
Magick++ help emulating composite -dissolve NN
user name
2006-02-23 15:53:17
Looks like the line I needed was this:

Logo.matteFloodfill("white", (MaxRGB*30/100), 0,
0, ResetMethod);

Doh!

Mike

P.S. PaintMethod:"ResetMethod" seems to be
described in the docs as only 
changing the matte of the pixels with the same colour as the
pen colour.

ResetMethod: Replace colors for all pixels in image with pen
color.


On Thu, 23 Feb 2006, Mike 'Mike' Jones wrote:

>
> I'm fairly new to using the Magic++ library, though
I've been using 
> ImageMagick on the command line for some time. I'm
trying to emulate the 
> following command line in c++:
>
> convert logo.gif  -fill grey50 -colorize 40  miff:- |\
>   composite -dissolve 30 -  in.gif out.gif
>
> I have tried quite a few ways to make this work, but it
seems that I cannot 
> apply an alpha channel to the logo.gif image before
compositing it, I've 
> tried saving to Blobs in other formats etc. but to no
avail.
>
> The section of my code looks something like this:
>
> ---%<---
> Image Logo;
> Logo.read(logo.gif);
> Logo.colorize(40,"grey50");
> Logo.type(TrueColorMatteType);  //doesn't seem to have
any effect
> Logo.matte( true );             // ditto
> Logo.opacity(MaxRGB*30/100);    // ditto
>
> Image image;
> image.read("in.gif")
>
image.composite(Logo,CenterGravity,DissolveCompositeOp);
> image.write("out.gif");
> ---%<---
>
> I believe I need to make the logo image have an alpha
channel and then set it 
> to 30 % of MaxRGB (the 30 argument to the dissolve
option in the command line 
> case but I can't seem to get this to work.
>
> Any tips?
>
> Thanks,
> Mike
>
>

-- 
http:/
/www.sve.man.ac.uk/General/Staff/jonesM/
_______________________________________________
Magick-users mailing list
Magick-usersimagemagick.org
http://studio.imagemagick.org/mailman/listinfo/magick
-users
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )