increase decrease contrast

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
eoor

increase decrease contrast

Post by eoor »

Is there any simple method to decrease image contrast? Option that i found for decreasing this value by convert program (+contrast) need to be passed twenty times to decrease twenty levels.Option -level works fine, but only for increasing contrast...Is any manner to decrease contrast insted of using +contrast?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: increase decrease contrast

Post by anthony »

I had the same problems...

-level can use negative and larger than 100% to de-contrast, but it is not very nice, or precise.

Then in IM 6.4.2 I added +level to increase contrast. Where -level maps the given values to zero/max. +level maps zero/max to the given values.

I went further to also add +/-level-colors which is the same as level but with the per-channel values being given as colors rather than numbers.

The +level-colors form thus will map a black and white image to any color gradient you specify (it does not even need to be RGB colorspace!)

All four and other related operators are detailed in IM Examples, Color Modifications, Global Color Adjustments
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: increase decrease contrast

Post by fmw42 »

see my scripts, bcimage or plm, at http://www.fmwconcepts.com/imagemagick/index.html
Post Reply