afre's G'MIC diary

Updates

1 afre_halfhalf CLI GUI
I made a new convenience filter that puts 2 halves of 2 images together like a before and after. Currently, it only appends the halves horizontally. The match_size parameter controls whether the smaller side fills the far edge if the images’ dimensions don’t match.

match_size=0 (The preview in my screenshot is cropped at the edges. Up to no good again. :angry: Don’t fret, the output is perfect. :shamrock:)

match_size=1

doghalf

Match size doesn’t account for orientations other than portrait and landscape.

doghalf


Discussion on what I have been investigating.

The issue that I have been having with the guided filter is that its performance depends on finding an optimal set of parameters. Sure, it is an issue for most filters, but for blur, e.g., a decrease or increase in value yields predictable results. To find an optimal values, the processing time would inevitably be longer.

Goal #1 Write command that finds optimal parameter values in a reasonable amount of time and applies the guided filter based on its assessment.


Another issue with filtering is that an image typically has multiple scales of detail. That is where multi-scale algorithms are required. This will take time to investigate and develop — what a hobby! :slight_smile: Again, I would have to find optimal values: this time, not just for one filtering task but one for each scale, and also determine how many scales would be reasonable.

Goal #2 A multi-scale guided filter that also does #1 (not an easy feat).

Actual progress

I have been experimenting with ways to stabilize the haloing that comes from guided filtering. The attractiveness of guided is that it doesn’t halo as much and is faster than filter that don’t generate (obvious deleterious) halos, which is why I love it and why FLOSS raw processors are using more and more of it the past year or so.

Anyway, at the moment, it is more show than tell. One technique looks promising. It isn’t perfect at some edges where it can differ by a radius width (hopefully not in a jagged manner). In the sailboat below, you can see the mast is a little thicker at one point. It is actually a bit like that in the original crop but a little more bothersome. Another issue is that it will call afre_gui0 8 times. If you are using slow settings, then you are going to have to wait for a while. That said, if it were not for G’MIC scripting, it would still be faster or just as fast as other filters because guided filtering is a fast technique.

From Play Raw How to improve this view (crop).

_crop

Test guided filter

_side

Difference

_diff

Sample tiger. Take note of the whiskers and the fur on the nose.

Test guided filter

Difference