Page 1 of 1

mask for histogram?

Posted: 2010-10-06T12:59:49-07:00
by janmartin
Hi all,

I need to run commands like contrast-stretch, normalize, auto-level and linear-stretch on an image histogram.
Problem is that the lower third of the image is totally black.
And the boarder to the top is not a line.

So I wonder if i can make a mask from the black part to have all the commands above to deal with the top rest of the image only?

What would the command line look line like?

Thanks,
Jan

Re: mask for histogram?

Posted: 2010-10-06T14:00:40-07:00
by fmw42
I have never tried any of that before. But you could try using -region (see http://www.imagemagick.org/script/comma ... php#region) and see if those commands will work only within that region.

Re: mask for histogram?

Posted: 2010-10-06T21:20:19-07:00
by anthony
fmw42 wrote:I have never tried any of that before. But you could try using -region (see http://www.imagemagick.org/script/comma ... php#region) and see if those commands will work only within that region.
It should work. -region works for any sequence of image processing operations that work with individulual images and not multiple images.

Essentually what it does is crop the region given from each image in the current image sequence, runs that though all the single image processing operators (mogrify type operators), then overlays that back onto the original image.

That would include -normalize, -auto-level, -contrast, etc etc etc.

It also includes image: drawing, warps, distorts, and resizes (weird but true you can resize the region! but results are not nice)

It does NOT include -clone, -swap, parenthesis, composition, -flatten, -clut

See the minimal summery of region in IM examples, Simple Image Warping
http://www.imagemagick.org/Usage/warping/#region