Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
-
smajler
- Posts: 28
- Joined: 2013-05-17T09:26:53-07:00
- Authentication code: 6789
Post
by smajler » 2013-12-04T03:41:21-07:00
Can anybody tell me how to do -flatten and -background in Magick++:
I was looking in MagickCore::CompositeOperator but i didn't find flatten operator. Something like backgorund i found, but how to do gray50?
-
dlemstra
- Posts: 1587
- Joined: 2013-05-04T15:28:54-07:00
- Authentication code: 6789
-
Contact:
Post
by dlemstra » 2013-12-05T00:49:48-07:00
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.
-
smajler
- Posts: 28
- Joined: 2013-05-17T09:26:53-07:00
- Authentication code: 6789
Post
by smajler » 2013-12-06T01:02:07-07:00
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?
-
fmw42
- Posts: 25761
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Post
by fmw42 » 2013-12-06T10:32:46-07:00
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.