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?".
I've been trying to figure out what sort of image manipulation would be required to get the same effect as the Fiji "Enhance Contrast" functionality (this can be found under Process -> Enhance Contrast). The values I'm specifically interested in, within Fiji, are 0.4 for the saturated pixels and "Equalize histogram" checked. What I thought would be the equivalent command would be:
But it generally is resulting in something that isn't the same... I've tried variations of contrast stretching and saturation, so any help would be awesome. This is a comparison, the left is the Fiji output and the right is the image magick output: http://screencast.com/t/9Br08lJz0
Last edited by pski on 2016-07-27T13:53:28-07:00, edited 1 time in total.
My apologies, Fiji (Fiji is just ImageJ [one of those recursive names]) is a free image manipulation software that wraps ImageJ. Specifically here's the documentation on it: http://imagejdocu.tudor.lu/doku.php?id= ... e_contrast (I'm doing the histogram equalization approach) and "Saturated Pixels" value of "0.4".
And as I re-read that, the "Saturated Pixels" is ignored when Equalize Histogram is checked... So I'm trying to figure out the difference between their implementation and ImageMagick's equalize approach.
By "before and after pair of images" I mean the actual files. Then we could download them, and experiment, and see which of the usual methods comes closest.
The doc says "Hold the alt key down to use the standard histogram equalization algorithm." Have you tried that, and compared the result to IM's "-equalize"?
If it's open source, I suppose you could find the code it is running.
IM's "-equalize" calculates the histogram, and equalizes it. The doc suggests their method takes the square-root of the histogram before equalising it. You can't do that with "-equalize", but my pages show how to (a) create a histogram and (b) equalize it, so it would be easy to insert a square-root.
It is always better to provide separate input and output images, so others can use your same input for testing.
According to your documentation, saturated pixels values are ignored when doing histogram equalization. So there should be no difference in IM -equalize. However, I do see a difference between ImageJ result and IM -equalize. So I do not know what they are doing differently, if saturate pixels is ignored. IM does not have that feature in its -equalize.
If I hold the alt key while processing, then I get something similar in IM to ImageJ, though not a perfect match.
What is your IM version and platform? Please always provide that information!
And you're right, it's very similar when holding the alt key. And like I noticed (after re-reading the documentation) the "Saturate Pixels" is ignored when using the equalize option.
Their documentation is accurate. I get a very similar result by calculating the histogram, taking the square root, cumulating it, and using that as a clut on the input.
I believe that IM uses the "intensity" (Y) value for the histogram when doing -equalize. Perhaps ImageJ combines the channels differently or uses the composite of the RGB channels to get the histogram.
I greatly appreciate the help! I was able to get the similar result that was within 6% (which is 'good enough' for my purposes). Thank you guys! Apologize for not being more clear in the initial post.