Page 1 of 1

masking operations

Posted: 2010-12-02T17:18:14-07:00
by GreenKoopa
I can limit the area affected by the -composite operation using a mask: http://www.imagemagick.org/Usage/compose/#mask Can this be done for other operations? I have been looking with no luck so I'm guessing not.

I want to modify a small part of a larger image, say using -blur or -fx. Right now I'm operating over an entire cloned copy and compositing the two using the mask. This is slow and complex, but admittedly workable. Even worse is modifications such as -auto-level or -contrast-stretch where operating over the entire image yields different results. (I also notice that -auto-level considers fully transparent pixels.)

Just a thought from a beginning user. Mostly ImageMagick is working out splendidly.

Re: masking operations

Posted: 2010-12-02T19:08:12-07:00
by fmw42
I think you are doing as best as IM can handle it right now as far as I know. But you might explore -region at http://www.imagemagick.org/script/comma ... php#region. But I have never used it before and it may be limited to a rectangular area.

Re: masking operations

Posted: 2010-12-03T00:19:06-07:00
by anthony
region is one method but works by extracting a rectangular area, and then giving that to the later "mogrify" type non-sequence image operations.

however there is no simple way of specifying when to 'finish' with the region.

See Working with regions (its actually not just for distorts, and probably should move to 'misc')
http://www.imagemagick.org/Usage/warping/#region



Another is to set a 'clip mask' which is essentially exactly what a three image compose does!!!!

See options -mask -clip -clip-mask -clip-path

I have not done a lot of experiments with these, as such have no documentation on them (yet)