afre's G'MIC diary

More experimentation using Iain’s test image.

“Denoised” Preview 1.5MP

“Denoised” Minimal Raw 6MP

Processing time is ~0.75MP/min. Faster than before…


If I clip and stretch the image, “Denoised” Preview looks nicer.

Another method (not guided filter driven) preserves more detail in some areas (snack graphics) but is block-y in others (lens).

Still far from what others can do but that isn’t exactly my focus. I am investigating new ideas and exploring strange new worlds. :vulcan_salute:

1 Like

Strange new world? Does this mean you’re going to make some fun filters like the filters I did which don’t do anything for photo-editing?

What I mean is that I am moving faster than I am realizing ideas. I am playing instead of achieving.

E.g. I have had the components to make a guided filter that matches or exceeds the very recent dt release for a very long time but I am not interested in putting one together. Frankly, the ones I have made are already fun to play with. No wonder Davids tend to put my commands into the fun category. They are more like gag toys that work if you know them intimately but are utterly unreasonable if you don’t. The same with the other commands. If I were about being practical, I would have mended them already, which I have for some of them; e.g. soft light used to be a little too unreasonable, so I made it useful and as a result boring.

I am more interested in exploring uncharted territory and doing idle nonsense because it is fun. Let’s just say I am writing G’MIC poetry in the way @chroma_ghost honed his creativity. I guess that this is what I have always done. I am simply declaring it now. Don’t you worry, I am still playing with “denoising”. Whatever that means with my buckets of sand.

More “denoising” fun

pencils_denoised

Looking good.

I think this would be a good candidate for my frequency domain detail recovery. You could test this using my noise reduction filter. You can test this by using two layers. Noisy one on top, clean one on the bottom, and in the filter select ‘guide recovery’. This means the filter is extracting the details from the difference between the layers.

This is the result of that using defaults.

Simpler and “faster” “denoising”.

pencils_denoised

1 Like

A long quest to find a satisfactory noise reduction filter. Let us hope you find it.

iain’s sample: half size preview

iain’s sample: full size raw (edit: smaller radius)


Note that all of the methods shown so far work well on smaller and less noisy images, for smoothing out imperfections or artifacts.

Last method

pencils_smoothed

Another go at “denoising”.

Half-sized preview

Full-sized raw

That denoising looks better than previous attempt. I wonder if it can solve the “issue image” I made at another thread. Never mind about that.

As implementation is concerned, I have these problems to solve.

1 Runs at a reasonable speed on my low end machine.
2 Can handle full- and half-sized images similarly.
3 Preserves enough detail to make the filtering worthwhile.
4 Code is easy to examine, understand and improve.
5 Respects physical properties of light and subject matter.

The question is where to compromise. I may have found a better balance this time. With the correct parameters, everything I have tried so far would work as input to @Iain’s denoiser. The challenge is to yield acceptable results without relying on complex code (Iain’s, and David’s on which his depends on). I am still going my own way (I like the adventure). I need not compete with other developments nor am I of a competitive nature.


Small Update

I am realizing how buggy (or limited) my commands truly are. Apologies for not having the wherewithal to address them. Don’t discriminate based on how a command or filter is currently categorized. Those in testing may be just as viable (or buggy) as those in a proper category. I encourage you to try them all, so you could motivate me to fix them. :wink:

After a long time of silence, today, I improved afre_brightness. Before, I would decompose the image into luminance and colour components, process them separately and then recombine them. Presently, for colour, I will process the image before separation. I shall adjust the other commands accordingly soon.

I also added a smooth parameter to prevent highlight blemishes in the source image from ruining the output when applying extreme brightness amounts. This might mean I could increase the range of the parameter. The filter may not be ready for that yet. smooth may need more work.

Bonus

I almost forgot to share a GIF I found on Wikipedia. The forum makes it a PNG. Follow the source link to see the animation and its credits.

image
Source: File:Smoothsort.gif - Wikimedia Commons

2 Likes

You don’t have to apologize, you’re just doing your best with the limitation of little amount of bug reports. I don’t get much bug reports with my own filters as well.

Hotfix afre_brightness became radioactive at lower amounts. Committed fix; update your commands / filters in a hour or so.

Update afre_contrast got the same treatment as afre_brightness and I expanded the amount range to [-200,200].


This is more of a commentary; therefore, more suitable for this thread than G’MIC exercises.

1 Unless I have a good reason, I found that iterations are not only wasteful but cause problems.
2 I don’t like boxfilter (it doesn’t suit my needs), which is why I made my own (not a box filter exactly), but mine is so much slower.

I started reading about various filters such as median and friends because I was exploring how various filters performed in terms of

a colour preservation
b edge preservation

Many artifacts come from a combination of the lack of the two and accumulate as processing progresses, which is the reason for point 1.

There’s always c++ for creating your own box filter and it will be faster than gmic, and yes that’s gonna take a while.

boxfilter is already a native G’MIC command, done in C++, and with OpenMP parallelization.
(good luck to make it faster :slight_smile: )

He said he wanted to make his own version which is why I suggested c++.

Changed the wording. Didn’t mean to imply that cimg / gmic’s boxfilter wasn’t fast or doing box filter things.

I recall my only experience learning programming fell flat in grade school when I was introduced to Turing. Maybe I wasn’t all that interested back then, or I was distracted by the teacher’s weirdness (he kept on talking about his failed projects and fanboy-ing Larry Ellison). Perhaps it is time to learn… Apparently, @anon41087856 learned C / C++ in a short time. Any advice would be appreciated.

@afre

None of my filters acknowledge alpha. Could you remind me how Krita handles images? Are layers always RGBA or CMYKA?