CLAHE - no real value for clip-limit?

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
User avatar
whugemann
Posts: 289
Joined: 2011-03-28T07:11:31-07:00
Authentication code: 8675308
Location: Münster, Germany 52°N,7.6°E

CLAHE - no real value for clip-limit?

Post by whugemann »

I have just noticed that IM obviously accepts only integer values for the clip-limit, i.e. the contrast limit. Why that? I have used values between 2.0 and 3.0 quite frequently with Fiji in the past, with 2.0 producing a rather natural look, 3.0 a significantly artificial look and anything between, well, something in-between.

I applied CLAHE to my tire example:

Code: Select all

magick tire.jpg -clahe 25%x25%+128+2 tire_C2.0.jpg
magick tire.jpg -clahe 25%x25%+128+2.5 tire_C2.5.jpg
fc /b tire_C2.0.jpg tire_c2.5.jpg
With the binary compare yielding no difference:

Code: Select all

Version: ImageMagick 7.0.8-23 Q16 x64 2019-01-02 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180040629
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo flif freetype gslib heic jng jp2 jpeg lcms lqr lzma openexr pangocairo png ps raw rsvg tiff webp xml zlib
Wolfgang Hugemann
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: CLAHE - no real value for clip-limit?

Post by magick »

Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ http://www.imagemagick.org/download/beta/ by sometime tomorrow.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: CLAHE - no real value for clip-limit?

Post by fmw42 »

I have tested CLAHE in IM 7.0.8.24 beta today and it does shows difference between clip limits of 2, 2.5 and 3
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: CLAHE - no real value for clip-limit?

Post by magick »

The clip limit can be fractional, however, small changes in the clip limit does not necessarily mean a change in the distribution of excess pixels due to clipping.
Post Reply