Release of G'MIC 3.3

Bonjour,

Here is a compilation of gmic-3.2.7_pre Win 64 for Gimp-2.99

File:
gmic-3.2.7_pre23070506_Win64.7z

Does anyone wants a math parser code that returns the closest number in list_of_numbers or the position of closest number?

My latest fix to Array [Random] [Jumble by px] might need something like that to avoid going into eval code.

Like this?

# cnln means closest number in list of numbers / cercano numberos en listo de numberos
cnln(5,1,3,6) => 6
cnln(-30,-5,7) => -5
cnln(5,1,5,8) => 5

Seems oddly specific for this thread… it may be more suitable for the exercise thread. It looks like the function finds the closest number to the first in the set: is that what it does?

I have already done my version of it. I brought it up because I thought it can be useful. It just looks for closest number and return closest number and order does not matter.

There’s also digamma(v) which I left code on my .G’MIC file.

Some other that might be useful are shuffle(vector) and gcd_shuffle implemented as a official filter.

EDIT:

I’m thinking of - for reverse direction.

foo :
  eval "
    closest(_args...) = (
      ref([_args],args);
      args[1 + argminabs(args[1,size(args)-1]-=args[0])];
    );

    res = closest(5,1,5,8);
    print(res);
  "

Gmic 3.2.7pre works with GIMP 2.99.16. :grinning:

1 Like

Hard sketch error /Gmic 3.2.7pre with GIMP 2.99.16.
G4asdDSre

Works for me. Does it happen always?

Also works for me on GMIC-3.2.7_pre / GIMP-2.99.16 Win 64

Not always. I don’t understand when it triggers.

Hi,

It seems a bit random but it happens to me as well with Felt Pen , on Linux Mint with 3.2.2 and Asahi with 3.2.6. Here I just launch the filter and set Edge to 100:

Log file isn’t too exciting:

Log File
[gmic_gimp_qt]./preview/ v 3 fx_feltpen_preview 300,50,1,0.1,100,5,0,50,50
[gmic]-1./ Start G'MIC interpreter.
[gmic]-1./fx_feltpen_preview/gui_split_preview/ Set global variable '__split_preview=fx_feltpen 300,50,1,0.1,100,5,0,50,50'.
[gmic]-1./fx_feltpen_preview/gui_split_preview/ Import custom commands from expression '_split_preview : run $__split_preview k[0]' (1 new, total: 4607).
[gmic]-1./fx_feltpen_preview/gui_split_preview/ Set local variable 'is_movable=1'.
[gmic]-1./fx_feltpen_preview/gui_split_preview/ Set variables 'posx=50' and 'posy=50'.
[gmic]-1./fx_feltpen_preview/gui_split_preview/ Set variables 'pw=810' and 'ph=754'.
[gmic]-1./fx_feltpen_preview/gui_split_preview/*foreach/ Set local variable 'is_failed=0'.
[gmic]-1./fx_feltpen_preview/gui_split_preview/*foreach/*local/ Apply command '_split_preview' on image [0], with a timeout of 0400 seconds.
[gmic]-1./fx_feltpen_preview/gui_split_preview/*foreach/*local/ Set local variable 'is_failed=1'.
[gmic]-2./fx_feltpen_preview/gui_split_preview/*foreach/*if/ Keep image [1] (1 image left).
[gmic]-1./fx_feltpen_preview/gui_split_preview/ Discard definition of custom command '_split_preview' (1 found, 4606 commands left).
[gmic]-1./ End G'MIC interpreter.
1 Like

Thanks, I’ve been able to reproduce the problem here as well.
Working for a fix.

Fixed! Filter update required.

1 Like

Suggestion: $() syntax. This allows one to use what inside the () to define which set of arguments to use.

m=$({expr('begin(n=0;);old_n=n;n=n+old_n+1;',4)})

The above is equilavent to m=$1,$3,$7,$15

Right now, a pretty decent workaround is to use local commands.

Basically, what I want to do is ${$string}. Should simplify part of my code.

Thank you very much for maintaining this wonderful software project. I just updated to the latest version. A few bugs that had been around for a while that I hadn’t reported (There have been rough years in my life, I didn’t pay attention to them), have disappeared. Now I’m going to enjoy the existence of G’MIC again. :+1:

1 Like

I’ll just leave this here:

After building version 3.3.0 (pre-release #23083009) my filters are listed twice in Gmic-Qt.
I suppose one from gmic itself and one from my local .gmic file. This wasn’t the case before. In any case it’s hard to tell which is which.

EDIT : Uglify appears only once though, even if modified in my local file.

Coud you share your .gmic file with me, so I can check what is going on?
Two filters with exactly the same name and path should appear only once, with the one in your .gmic file having the highest priority.

File sent. Maybe i messed something up with my touchpad? Ihad to disable “touch to click, etc” because I was modifying /deleteing stuff (very annoying).

Oh, I know why… I just remembered that I renamed my commands from fx_xxx to pr_xxx.

Haven’t updated the file in the repo in ages…