to control the contrast level???

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
Bassamdo01

to control the contrast level???

Post by Bassamdo01 »

I am using Image::contrast(unsighned int sharpen_). to control the contrast.
but it does not work good, first what he value range of sharpen_?? how to use it

thank you ...
Bassam Alsanie
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: to control the contrast level???

Post by fmw42 »

Bassamdo01 wrote:I am using Image::contrast(unsighned int sharpen_). to control the contrast.
but it does not work good, first what he value range of sharpen_?? how to use it

thank you ...
Bassam Alsanie

I don't know if this will help (and don't know much about IM APIs), but the command line version of -contrast does not have any parameter. You have to repeat the operation. see http://www.imagemagick.org/script/comma ... p#contrast
rmagick
Posts: 245
Joined: 2006-03-16T17:30:48-07:00
Location: Durham, NC, USA

Re: to control the contrast level???

Post by rmagick »

Bassamdo01 wrote:I am using Image::contrast(unsighned int sharpen_). to control the contrast.
but it does not work good, first what he value range of sharpen_?? how to use it
Image::sharpen is defined in Image.cpp. It calls ContrastImage in the MagickCore API. ContrastImage takes a boolean argument. If 1, it increases the contrast. If 0, it decreases the contrast.

In general I've found that the easiest way to figure out the Magick++ API is to read the source code in the Magick++/lib directory. All the Magick++ methods call functions in the MagickCore API (in the magick directory), which is generally well-documented. In any case you can always read the source code.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: to control the contrast level???

Post by anthony »

You can also use -level (and its API equivelent) for a finer control of the contrast operation. There is also the reversed forms of level (+level on command line) I added near the end of last year.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply