Release of G'MIC 2.6

Just wondering: what is the purpose of labelling the loop count?

For a single loop, there is indeed $> for the counter, but in case of nested loops it can be nice to have named counters:

foo:
  sp david,32
  repeat h,y
    repeat w,x
      = 0,$x,$y
    done
  done

It didn’t occur to me: I normally stay away from nested loops. I also didn’t know that = 0,$x,$y could be done like that. I would do it like this sh 0 fc. 0 rm. Could you point me to where it is in the manual? I still find it hard to find things in the references.

And you are right, G’MIC being an interpreted language, nested loops should be avoided as much as you can, particularly if it involves many iterations, for performance reasons.

That’s indeed the best way to do it! My example was just an example to show there can be some particular cases where named variables in loops may be useful. Not a very good example in this case, but I wanted to keep it simple.
But one good suggestion : don’t do XY loops over image pixels like this !

Actually, I was asking about = 0,$x,$y. I wasn’t aware that this syntax could set a value to a coordinate. Don’t know where it is in the manual.

Ah ok, that’s because = is also the name of a shortcut, for command set
(https://gmic.eu/reference.shtml#set)

Thanks. There are literally thousands of = signs on the page. I mentioned this before: the removal of single quotes in the formatting has made it much harder to find things. E.g., before, I could do a search on ‘=’.

Try “gmic h =” and find the answer!

1 Like

It’s true that I also find that using the cli tool gmic to get the reference for a particular command is easier !

True. I guess I am always trying to be in another’s shoes, so the typical user would go to the docs for help. :wink:

No, no, I have the problems too to find something in the documentation. My way is always searching for commands e.g. in strange scripts, from David, to use the cli gmic with help first. If that fails I am searching in the reference text file generated by “gmic h”! The disadvantage is that help delivers only the the result of gmic_stdlib.gmic, the corresponding script file update.gmic used in background is much larger (and there are of course the gui custom functions too)

Speaking of gmic help [command], I find that it depends on the command. Sometimes gmic [command] reveals more info; other times, nothing.

Any example ?

I bit off topic, but I remember that there are company interest in using GMIC sometime ago, how was it?

Got no news :frowning:

Actually the preview gmic 2.6.0 does not show the help for all commands

gmic h terminates with “same aspect than those illustrated in the example codes.” in chapter 12.

specific help works!

I’m using the last git source on Mac

Hum… it works for me. Could you try a make clean before recompiling make cli ?

No change!
I did “(cd ~/sw/gmic/src/; make clean ; make -B cli “SUBLIBS=-lX11” || exit)”

And with a $ gmic update ?