Page 1 of 1

CLAHE - no real value for clip-limit?

Posted: 2019-01-07T06:50:26-07:00
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

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

Posted: 2019-01-08T05:23:01-07:00
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.

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

Posted: 2019-01-11T17:02:10-07:00
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

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

Posted: 2019-01-12T13:45:00-07:00
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.