-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
ImageMagick version
7.0.10-24
Operating system
Windows
Operating system, version and so on
11
Description
ImageMagick has the brightness-contrast command line option which is quite unintuitive for non-obvious reasons.
Had to look up the implementation to find how it actually is producing the results it outputs.
MagickCore/enhance.c in BrightnessContrastImage:
slope=tan((double) (MagickPI*(alpha/100.0+1.0)/4.0));
I would propose the following more intuitive definition by attaching it to the histogram:
- +50 would have slope 2 so all input values would be mapped to half of the output value range.
- -50 would do the opposite, half the input values would be mapped to the full output value range.
more formally:
slope = contrast/100+1 if contrast < 0
slope = 100/(100-contrast) else
Steps to Reproduce
magick convert test.ppm -brightness-contrast 6x-20 out.ppm
Images
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels