IM on OS X: Use mask to split an image
IM on OS X: Use mask to split an image
I would like to take an image, apply a checkerboard pattern to it so that the result is two images one having the even squares of the original image + transparency and the other having the odd squares of the original image + transparency.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: IM on OS X: Use mask to split an image
Make the chequerboard in black and white. Then ...
... will make one output file. For the other, leave off "-negate".
Code: Select all
convert infile ( chequerboard -negate ) -compose CopyOpacity -composite outfile
snibgo's IM pages: im.snibgo.com
Re: IM on OS X: Use mask to split an image
Thank you!
For posterity... this is how you can make a checkerboard:
For posterity... this is how you can make a checkerboard:
Code: Select all
convert -size 640x480 pattern:checkerboard -auto-level +level 0,100% checkerboard.gif
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: IM on OS X: Use mask to split an image
There should be no need for +level 0,100%, which is a no-op (does nothing) in this case. It would only be needed if you want to change the checkerboard to something of less contrast if you use values other than 0 and 100%convert -size 640x480 pattern:checkerboard -auto-level +level 0,100% checkerboard.gif