I am looking into getting back into some programming/scripting and want to dive into the world of image processing to make learning more interesting and creating some personal tools.
I was considering possibly learning g’mic scripting to make some one off processes. Would it say be possible to use g’mic scripting to focus merge a image by implementing say a pyramid or depth map algorithm?
If not there are other options just wondering because g’mic seems to be very handy after seeing some filters people have made.
G’MIC is good at prototyping. So yes, it can be done with enough patience. The downside is that it is on the slow side. For faster processing, you would have to use its lower level C++ counterpart CImg.
fill is equivalent to for x,for y, for z (insert value at end at x,y,z), and begin()/end() can be used to define variables. I use it for non-constant variables that needs to be updated after begin organize constant variables as well as macro.
Arguments within g’mic-qt are treated as strings.
eval is better for processing that are not inserted within x,y,z on for x,y,z.
shared is used to speed up filter. Rather than using s c, you can use shared to perform operation on a channel, then remove it.
repeat $! l[$>] endl done is a classical way of applying a filter toward different images
Thanks for the info will look through it and experiment I guess that is the only way to really learn it. As well as getting enough understanding to look at other filters to learn from then. The syntax looks pretty cryptic
The G’MIC syntax indeed looks a bit cryptic, but mainly because it has been designed to make short programs. Once you’ve got the idea of item substitution (https://gmic.eu/reference.shtml#section8), everything becomes more clear.