afre's G'MIC diary

Oh, I misread the command. It was pretty late, and didn’t really test the command. Apology for that.

Update

So yeah, afre_norm exists now. It is norm but normalized to image range with the option to keep the number of channels. Notice that the parameter name starts with an underscore. This means the command can go noarg. Makes it less awkward, to have to type the whole thing. The default is to keep, which I don’t desire but we live in a 3-channel RGB world (or a RGBA one if we want to be considerate to Rep and friends; I guess, for them, I would have to add an option omit the alpha [to do].).

afre_norm:
    _keep_channels={ 0 | 1 }

  Compute normalized norms of selected images.

  Default value: 'keep_channels=1'.

Update your G’MICs at your leisure.


Oh, a post wouldn’t be complete without yet another customary “denoise” image. :wink:

pencils_again

I also live in a CMYKA world as well (if using cmyka processing on filters count. And many of my filters have cmyka filter processing option or users define it as cmyk rather than rgb.).

For alpha, drgba is a good filter to use to test alpha results, but you’d have to keep in mind that 255 is 1 in drgba.

Also, I love the denoise result. One of your best attempt.

Do you see a use case for CMYK(A)?

If the command passes through one or more channels, I would have to do one or both of the following.

Do nothing to first or last channel
1 2 3 4 5
1 0 0 0 0 or 1 0
0 0 0 0 5 or 0 5

Let user choose which channels to operate on
1 2 3 4 5
0 2 3 0 0
1 0 3 0 5
0 0 0 4 5 or 0 4 5
1 2 0 0 0 or 1 2 0

There is a usecase for CMYK(A). If your filter is basically a fun filter, and CMYK(A) gives a different result, then you can add it in addition to color space model parameter. I almost always add color space options and will add cmyka if it allows me to get interesting result.

Nice Updates

1 Fix afre_portraitmontage: discontinuity in frame mat. To-do: add echo, other masks (ovals, none, etc.).

2 Tweak afre_gui1*. smoothing=0 now since the main objective is to transfer structure not smooth.

3 Tweak afre_norm. Add parameter info to echo.

4 Add afre_gradientnorm. Like gradient_norm but with channel and range parameters. keep_range=1 to inherit the range of the input image. keep_range=0 to give it a mask range ([0,1]). NB Be aware that this is different from afre_gnorm, which is a prototype of afre_edge.

afre_gradientnorm:
    _keep_channels={ 0 | 1 },_keep_range={ 0 | 1 }

  Compute normalized gradient norms of selected images.

  Default values: 'keep_channels=1' and 'keep_range=0'.

5 Add afre_hessiannorm. Like afre_hnorm but with channel and range parameters. Similar to afre_gradientnorm but with hessian.

6 Add afre_dilateg afre_erodeg afre_openg afre_closeg, which perform geodesic morphology, where the structuring mask defines the domain in which the filtering may take place (rather than filtering by a predefined kernel shape). Useful in segmentation and reconstruction. NB These commands are slow because they are naive in their approach, relying on iteration.

7 afre.gmic Sort commands and place them under new categories. Also included empty newline comments to denote that the command is to standard (#) or I have more planned for it (##).

8 Update afre_orien to include counterpart to afre_norm. To-do Add more modes, no-arg.

9 Update afre_maxmin and afre_minmax to accept an arbitrary number of channels.

10 Add afre_montagex and update afre_portraitmontage to match. Differences:
– The new afre_montagex doesn’t resize and allows custom row length.
afre_portraitmontage auto resizes and arranges, matte shapes (circle or none; more to come).


Update your G’MICs in a hour or so.

1 Like

Someone is on fire! Keep it up.

Updates

1 Upgrade afre_portraitmontage is now complete. The code is nicer and bug checked. It has resize options (small, large) and more matte shapes (none, circle, polygon, star). To-do Add matte shapes suitable for afre_montagex.

2 Add translation_en.gmic and translate samj_reptile (not much but a start). Didn’t realize this translation method was deprecated.

2 Fix afre_box_fast to make radii<3 fast. Benefits afre_sdpatch and afre_gui*_fast based commands.


Update your G’MICs in a hour or so.

1 Like

This is an example of geodesic morphology. afre_openg 7 will remove the apostrophe ' because its width is less than 7px wide (6px).

afre_openg_7

This is how a regular open (7px) would appear. Looks like a made up sci fi or fantasy language.

regular_open

1 Like

what would be cool is a gif of this…

openg

2 Likes

This time with sample barbara afre_openg 7.

Original

_barbara

Loop of the second part of geodesic opening

openg

1 Like

This is neat! Thank you for having tried!

Yet another “noise suppression” attempt.

JPEG Preview - “Denoised”

Pencils Noise 40 - “Denoised”

pencilsdn2

1 Like

It’s looking good. By the way, remember that you wanted to do multi-threaded evaluation, and then move on into next row/column? One could do that with a image strip, and insert a repeat({w or h or d}, I(#ind,tx,ty,tz)=expression;);.

Yet another “noise suppression” attempt. No machine learning, just mild-mannered fun with afre.

Before (source: Exporting/importing photos in full 32-bit representation (to train a neural network for image denoising) - #85 by Peter)

After (on JPEG above, not raw original)

PS Closeups (using my unreleased auto-crop command)

Before

_bird_denoise_a

After

_bird_denoise_b

1 Like

A bit heavy handed, I think!

There’s some luminosity noise, but the result is good.

Yes, it is more suited for noise texture removal. By texture, I mean noise and soft edges. Combined with Iain’s recovery algorithm, it would be a good denoiser.

2 Likes

Yes! The detail recovery algorithm does best when textures have been removed but edges have been kept.

Here is the bird with the details recovered.