-flatten

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
smajler
Posts: 28
Joined: 2013-05-17T09:26:53-07:00
Authentication code: 6789

-flatten

Post by smajler »

Can anybody tell me how to do -flatten and -background in Magick++:

Code: Select all

-background gray50 -flatten
I was looking in MagickCore::CompositeOperator but i didn't find flatten operator. Something like backgorund i found, but how to do gray50?
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: -flatten

Post by dlemstra »

You can set the background like this: image->backgroundColor(Color("gray50"));

In STL.h there is a method called flattenImages that you can use to flatten multiple images.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
smajler
Posts: 28
Joined: 2013-05-17T09:26:53-07:00
Authentication code: 6789

Re: -flatten

Post by smajler »

yes there is flattenImages but how to use it? It takes few images but i have one.

Code: Select all

- clone 1,3 -compose subtract -composite -background gray50 -flatten
First i subtract image 3 from 1, then i adds background50 to image 1(subtracted) and what about flatten. It flats image 1(subtracted) with image 3?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: -flatten

Post by fmw42 »

You only need to use one image and a background color. It flattens the image against the background color rather than another image. It is like creating an image of the background color and flattening the image against the color image.
Post Reply