GMIC filter edited

I always loved GMIC going way back to when it was still just doing NR as GREYC’s. Of course I use the Gimp plugin but the last year I’ve really started to integrate GMIC from the CLI into bash scripts and right-click context menus in KDE.

@David_Tschumperle’s fx_illustration_look script happens to be one of my favourites but sometimes I find it a bit too harsh.

As a plugin, I often had the output to layers box ticked so I could vary the opacity of the layers to create a more/less harsh illustration look. I had been searching for a way to do so from my bash script as well and I just added a copy to the ~/.config/gmic/updatexxx.gmic text file with a small change and called it fx_illustration_look33 (actually, since, I also added a 20, 50 and 66 version) with only these two lines changed (opacity from 100 to 33):

mv[graphicnovel_layer] 1 =>[graphicnovel_layer] "name("$nm" [Paint]),mode(normal),opacity(33)"
mv[blur_layer] 2 =>[blur_layer] "name("$nm" [Base]),mode(normal),opacity(33)"

And the following line removed:


The difference is quite pleasing and I have now adjusted my bash script to select either option. The edited fx_illustration_script takes the image and results in:

Here’s a side-by-side comparison between the original shot, the basic fx_illustration_look output and the 33% transparency version:

1 Like


you should use the .gmic file in your home folder for this. Just copy the filter script there.
The updatexxx.gmic file might be replaced the next time you update your filters and you would lose your modification.

1 Like

Great point. Thanks!

The original script is here (line 49 to 79 )

Not sure what the relevance is to my post TBH. I know that’s where the original resides.

Then i’m sorry , i thought you didn’t.
But in any case it was just to say it’s easier to copy the script from this file, which is more readable, than edit update.gmic.

No harm done but I loaded update.gmic into Kate which allows me to search relevant bits fairly easily. Nevertheless, your advice to put it in ~/.gmic was very much appreciated as I did realize any update would wipe out my edits.

1 Like

@Mike_Bing thanks for the kind words.
What I propose is to add a Strength slider to the filter, going from 0 to 100.
I’ve made a filter update that does this change.
I think it’s indeed a great idea to be able to set the strength of the effect.

The only drawback I see is that you’ll need to change your scripts to take this new parameter into account.

Tell me what you think about it.

1 Like

That should not be an issue at all! Thank you so much, David - justing adding the opacity parameter as a first as in:

fx_illustration_look 33,0,0,0,1,0

Am testing the new version as we speak. Awesome.

1 Like
    mv[detail_layer] 0 =>[detail_layer] "name("$nm" [Detail]),mode(grainmerge),opacity(100)"
    mv[graphicnovel_layer] 1 =>[graphicnovel_layer] "name("$nm" [Paint]),mode(normal),opacity(50)"
    mv[blur_layer] 2 =>[blur_layer] "name("$nm" [Base]),mode(normal),opacity(100)"
    if $1<100
      mv[base_layer] 0 =>[base_layer] "name("$nm" [Original]),mode(normal),opacity("{round(100-$1)}")"

In the new script the $1 variable seems to impact only the base layer but in my version it left the base layer as-is and effected both the [detail_layer] as well as the [graphicnovel_layer] like this:

    mv[detail_layer] 0 =>[detail_layer] "name("$nm" [Detail]),mode(grainmerge),opacity($1)"
    mv[graphicnovel_layer] 1 =>[graphicnovel_layer] "name("$nm" [Paint]),mode(normal),opacity($1)"

And just always leave [base_layer] in place. How is that?

That’s because in my version, I put the original image as the top layer, alpha-blended with 100-strength% opacity.

1 Like

Of course! So much more elegant and simple.