Page 1 of 1

-flatten

Posted: 2013-12-04T03:41:21-07:00
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?

Re: -flatten

Posted: 2013-12-05T00:49:48-07:00
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.

Re: -flatten

Posted: 2013-12-06T01:02:07-07:00
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?

Re: -flatten

Posted: 2013-12-06T10:32:46-07:00
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.