Ah thanks. I don’t know what echo pass does though.
In any case i’ll rename it because I like shortcuts to be … short, and I don’t want to see my name everywhere in my files xD dab could cause problems later so I’ll go for pr_dab, or maybe pr_d.
Maybe I’ll ut this in the repo too, If someone needs it.
TBH I had totally forgot about the .gmic file, there was some old lost scripts in there…
Yes I usually do that with Bash. But with Gmic I usually insert a d in a condition, It’s very easy to see if it worked. Also, I was confused because there is a pass command in g’mic…
I modified it a little bit so that it doesn’t try to blend if there’s only one image in the list.
#@cli pr_dab: image_1,image_2,...
#@cli : Create alpha-blended images using existing images and insert onto the last list. If no arguments are specified, all images are blended as a new layer.
pr_dab:
if $!>1
if $#>1 echo TEST +blend[$*] alpha
else +blend alpha
fi
fi
display
BTW it never echoed TEST , so I really don’t know how this if $#>1 thing work I guess?
my example was just this test: gmic run '800,800,1,3 circle 50%,50%,200,1,255,120,120 repeat 360 thickline 400,400,10*{200*cos($>)},10*{200*sin($>)},2,0.9,${-rgb} done '
Does this mean I don’t need to use floor() when setting random RGB values with u? What happens when RGB values are floats? Are they automatically rounded?
They are not rounded, but “casted” (in the C/C++ sense) to integers, if the output format doesnt support float-valued pixels (so, basically jpg or png).
My opinion on this : there are no reasons to limit yourself to integer-valued pixels when generating images, at least until you save them.
You should consider that an image is a float-valued array, then ask yourself about the value range and type only when you want to export your image in some way (output a file, or display it in an unnormalized display).
That will surely simplify your scripts a lot !
I see. I didn’t like to see all these floats like 1.487638764875, and thought that maybe they would slow down things a bit. But I’ll do a code clean up when I can. Thanks for the advice.
No, images in G’MIC are all stored in float-valued format.
Having floats that are actually integers does not speed things up.
The only thing to avoid when possible, is having floats that are NaN or +-inf, as doing arithmetic with such values is indeed generally a bit slower in the CPUs.
Even worse in much more rare case, a BSOD error. I actually have if(xn==inf||yn==inf||xn==-inf||yn==-inf,break()); code just to stop BSOD from showing up in one of my CLI filters.
I don’t think i’ve run into this yet. Let’s hope I won’t
About circle and lines :
Which one do you like? Each uses a different way of tracing the lines.
BTW I don’t know how to increase the polygon width in your example (I was using thickline in mine)
is there any way to make flower (or transform_polar) behave more erraticaly (without bursting the maths)? I find it a bit too regular here (pupil), i want to have some long spikes here and there, irreglarly.
Or maybe i should draw some (very) thin ellipses here and there to break the monotony?