mask for histogram?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
janmartin
Posts: 4
Joined: 2010-10-06T12:53:04-07:00
Authentication code: 8675308

mask for histogram?

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: mask for histogram?

Post 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.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: mask for histogram?

Post 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
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply