Discerning features


I am not good with colors or complexity :confused:, so I manipulate images to better observe their features. In general, my approach is random and inefficient – where did my life the time go? Beep hobby! :blush:

One strategy is to convert color images to gray-scale or binary (color-to-gray, to-channels or to-scales). Isolating features in this way can also help us visualize the impact of noise, blur, etc., on the image and develop masks for image enhancement, etc. However, complexity reduction often comes at a price, where we can get false positives or negatives.

This is a broad topic with many entry points. Let us begin with the following:

In particular, I am looking for ideas and techniques that are accurate yet simple to understand, and work even when contrast is low and noise is high.

I welcome everyone’s input, though I encourage @David_Tschumperle and G’MIC devs/users to offer their take on the subject since I tend to use G’MIC (command-line). It would be a treat if someone could make a G’MIC command for color-to-gray (PCA) or CLAHE, or point to related commands/filters. Thanks!


Interesting that I have the opposite problem… I find it difficult to visually assess brightness/contrast, which lead to the “image infomap” G’MIC filter; it shows tones in spectral form, translating tones to colours (a very simple thing to do). Of no use at all to anyone with colour blindness but I suppose it could be done with two instead of three primaries.


I likely have a slight case of deuteranomaly but I generally have problems processing and interpreting visual information. It takes much more time to identify and discriminate.

Back in my school days, I had a terrible time with courses that involved visual skill such as biology and geology (identification, recognition and visual memory) or law (visual endurance due to amount of reading material). I often have to compensate with my other senses or do stuff like move my head back and forth to take advantage of parallax.

gcd_spectral is pretty intense. Reds used to pop out like that when I was younger. Now that I am older, it happens less. Just to be clear: what exactly am I supposed to see with each option? I have a good idea because the names are fairly self-explanatory but I would like to confirm.


The options are:
Spectral tones - as described; dark tones are translated to blue, mids to red, highlights to green
Detail map - difference between norm of bilateral and image norm (bilateral params can’t be chosen)
JPEG CbCr detail - YCbCr chroma channels equalized and displayed in greyscale
local equality - map of pixels with identical values to 8-connected neighbours

I use it to check for image defects because sometimes it can be hard to tell whether a filter I’m making has introduced artifacts, or it’s an issue with the original. That’s more an issue with compressed of course.

Back on the subject of PCA, I don’t know of one already in G’MIC. The closest I know exists is k-means colour matching (-index and -autoindex), I’m not certain it could reduce to smooth greyscale. PCA could of course be implemented in a few ways, I can’t promise to produce one any time soon. Maybe somebody else will have a go before me…


Maybe “Dstretch” is an example of what is possible with decorrelation?

Dstretch is a unique (not free for professionals, not open) plugin for ImageJ, written by Jon Harman.

(edit) Dstretch algorithm description:

He made Dstretch to “bring out faint pictographs that are invisible to the naked eye.”


Maybe you can also play with “G’MIC>Details>Local variance normalization” by Jérôme Boulanger. Then use for example HSV_s, HSV_h or Lch_c. You can play with it and exaggerate the result. (This is not for nice pictures)

(Morgan Hardwood) #7

Those dstretch examples are quite amazing!


I have used -autoindex before but not to emphasize features or generate a grey scale image. BTW, I am still interested in PCA if you have the time to give it a try.

(Mica) #9

Those sites are actually quite close to my home town! Pretty cool.