Release of G'MIC 3.4

I am sure I have seen this somewhere. Maybe some code on GitHub or Google Scholar. I suggest we post non-change-log-related items in new or exercise threads so they are easier to search for in the forum. :wink:

This was more g’mic specific, as in is there a g’mic optimised way to do a transpose multiply in a single step. In theory there’s some extra in-buffer copying could be avoided by that and it’s a common matrix operation. Anyway, you’re right that I could put these questions in one of my own threads.

1 Like

Is map slower than it was? I don’t get the similar execution time as I did here - G'MIC exercises - #1053 by Reptorian .

Now, it’s.05 s as opposed to .002 s. The change I did wouldn’t affect the time at all.

Command map now accepts a palette name (since a year or so), so the parsing is a bit more complicated than before. It may explain the time difference you see.

I don’t think that affects time that much. If I apply map to a small image, I get the expected time which is ~0 s.

Update with latest G’MIC and execution time is now significantly worse at a global level. Plus, there doesn’t seem to be a output of image information display via CLI. Actually, I don’t know what happened to image information display.

C:\Windows\System32>gmic 512,512 v - tic rep_pfrac 50 toc v +
[gmic]./ Start G'MIC interpreter (v.3.3.3).
[gmic]./ Input black image at position 0 (1 image 512x512x1x1).
[gmic]./ Elapsed time: 0.384 s.
[gmic]./ Display image [0] = '[unnamed]'.
[gmic]./ End G'MIC interpreter.

C:\Windows\System32>gmic 512,512 v - tic rep_pfrac 50 toc v +
[gmic]./ Start G'MIC interpreter (v.3.3.3).
[gmic]./ Input black image at position 0 (1 image 512x512x1x1).
[gmic]./ Elapsed time: 0.521 s.
[gmic]./ Display image [0] = '[unnamed]'.
[gmic]./ End G'MIC interpreter.

Top one is old, new one is bottom. It never reached .4 s with the old version.

New stdlib update should fix this problem.
Concerning the timing, I don’t know what happen. I’ve only made minor modifications on the interpreter code recently.

Timing is better with the new stdlib. Much closer to the old version now.

I want to make tests with -Ofast, and other options. How can I do that? I can compile G’MIC no problem. Now is the time I’ll do code on the internals

Been thinking about binary literals being useful. After the utf-8 supporting commands, thinking about implementing double dabble algorithm for converting big binaries to decimal, and improvement into stdlib bin2dec command. Is it possible? Like 0b1111 in my UTF-8 script would make it clearer on how it mask binary values for example or just 0b$1 in bin2dec makes it readable too.

implements the warp() function for the G’MIC math evaluator.
I think someone has requested this a few weeks ago.

1 Like

implements the permute() command in the G’MIC math evaluator.
To avoid confusion, the old function permut() is renamed to perm() (as in Python).

1 Like

Just changed it in gmic-community. I would prefer combinatorics(), but that’s fine too.

adds a new function histogram(A,nb_levels,_min_value,_max_value) that returns the histogram of the input vector A. This is the analog of the command histogram in the math evaluator.

1 Like

OK, so today was productive, with 3 new math parser functions : histogram(), permute() and warp().
I’m looking at the list of G’MIC commands right now, focusing on the native ones, but I don’t see other interesting commands to ‘convert’ into a math parser function.
If you have suggestions, I’m all ears (considering that only native commands should be converted as the command to convert must already have a C++ implementation).

EDIT: Ha, I see that equalize() could be great, I will do it.

EDIT2: Here it is :

3 Likes

Is there already something like discard()? It’s a good one for optimisation sometimes.

The problem in having functions in the math parser that operate on vectors is that the size of the output vector must be known at compile time.
Which is not something you could have with a possible discard().

Ah of course, sorry. I will have a think about others which don’t have that problem!

mirror() is on the way ! :wink:

1 Like

That’s possible with dynamic array images and your own custom macro. Not that fast, but it’s better than nothing. I would love to have math parser things works on dynamic array images.