The second one is really cute!
There is a Paint.NET
plugin that reminds me of this, but I don’t know which one. But it already look better, so useful. I’d like alpha though. As well as stringify to get alpha.
Oh I see. But if your original image has an alpha channel, it is retained.
The alpha value is missing on mine. I will have to check on that.
Because i’ve just added it to the mod. It’s not on the original stringify
.
When i removed my .gmic file from Gmic_qt i noticed some of my filters were missing when they were supposed to be in Testing for some time already. That scared me for a minute…
Then i found them in the official folders (?!?) and saw this too in stdlib:
move_filter "Testing/Prawnsushi/Degradations/Sloppy Mess","Degradations"
move_filter "Testing/Prawnsushi/Rendering/Underwoods","Rendering"
move_filter "Testing/Prawnsushi/Channel Shuffle","Degradations"
move_filter "Testing/Prawnsushi/Iris","Rendering"
move_filter "Testing/Prawnsushi/Little Boxy Things","Arrays & Tiles"
move_filter "Testing/Prawnsushi/Nonscape - Grass","Rendering"
move_filter "Testing/Prawnsushi/Nonscape - Woods","Rendering"
i wasn’t aware of this at all since i have my whole file taking over on my computer lol. Don’t know when you did all this…
Yes, that was done just before the release of the version 3.5.0 of G’MIC.
The rules have changed a bit, so right now, it is not possible for authors of community filters to directly push their filters in the main filter tree. These move_filter
commands are the way to move them from Testing to somewhere else.
All for the better, i thought i had messed up something in my file… But more work for you though.
Hi,
can someone tell me why i can get circles but no ellipses with this code?
if $size S="$>" else S="$<" fi
repeat 1000 {
if $motif
ellipse 50%,50%,$S,$S,0,1,0xFFFFFFFF,255
else
circle 50%,50%,$S,1,0xFFFFFFFF,255
fi
}
Ellipse returns : invalid argument 50%,50%,$>,$>...
Is it treating $>
as text? circle
really works here though.
Did this to avoid setting S
a thousand times.
I’ll just add a silly question too. How do I ensure empty vars are skipped?
skip $*
is not working.
skip "$*"
is not working either.
This is probably wrong.
Instead, try
if $size S=$> else S=$< fi
When putting things inside double quotes, you basically disable the substitution mechanism (both for variables and math evaluation), so $>
and $<
are not substituted by the current loop indices.
This is true for any variable :
var=1976
echo $var # -> will display 1976
echo "$var" # -> will display $var
Note that this rule is not true for the few $-expressions listed here : G'MIC - GREYC's Magic for Image Computing: A Full-Featured Open-Source Framework for Image Processing - Adding Custom Commands
which are used only in the context of writing a new command (things like $1
, $2
, $#
, …).
Technically, those are actually not variables but just expressions that will be substituted when the command is instanciated (and not when the interpreter reaches the corresponding code).
So:
foo :
var=1976
echo "$var and $1 are not the same kind of expressions!"
echo "you need to break the quotes to display "$var"!"
and then:
~$ gmic foo 2025
[gmic]./ Start G'MIC interpreter (v.3.5.1).
$var and 2025 are not the same kind of expressions!
you need to break the quotes to display 1976!
[gmic]./ End G'MIC interpreter.
I hope this helps.
Thanks for the answer.
I put it outside the loop so that S isn’t defined 1000x, that’s why i quoted them. And reading your answer, the fact that it works for circle
is quite mysterious.
If i unquote them outside the loop, $>
and $<
will (i think) always be equal to 0 (and nothing visible happens).
So i guess i’ll have to put if $size S=$> else S=$< fi
inside the loop then, that is sure to work.
While modding stringify i tested some things like com="sponge "$var
(Thought i’d try with $>
), so i found out about breaking quotes (thinking about it i do it when using
to
) .
I see. Not sure if a variable redefinition is that slow to make such an optimization interesting.
What you want is actually a loop whose code is different when the argument $size
is different.
Simplest way of doing that would be to use the ${"-command"}
expression, like in:
if u<0.5 S="$>" else S="$<" fi
repeat 10 {
run "u "$S
echo ${}
}
But I’m pretty sure this will be slower than doing a simple if
inside the loop (not tested though). You can also avoid an explicit if
by using the math evaluator here:
if u<0.5 S="$>" else S="$<" fi
repeat 10 {
ind:=$S
echo $ind
}
but that does not avoid the variable assignment.
Well, sounds a bit more complicated than what i need. It’s just the same command but with a different param, so not really a different code (but in a way it is different). Here, increasing $>
or decreasing $<
the circle
size.
Is there a simpler (shorter, lest fastidious ) way to create a palette from GUI colors boxes? Only 8 colors there but maybe i want 16 (that will make a really ugly GUI though):
($11,$14,$17,$20,$23,$26,$29,$32\
^$12,$15,$18,$21,$24,$27,$30,$33\
^$13,$16,$19,$22,$25,$28,$31,$34)
Also, is there a way to make I
loop back to the beginning of the palette ? col:=I[#-1,$off,2]
It’s the first time that i use it, so i used a var to reinitialize it.
Will boundary conditions do that?
off=0
repeat 100 {
if $>%$occ==0
if $35==0 col:=I[#-1,$off,2] fi
off+=1
if $off==8 off=0 fi
ellipse[0] bla,bla,bla,$col
fi
Been working on making a really flexible tool for palette.
Probably not much easier. Maybe you could benefit?
mmmm. Well. Don’t know The code for this is already 10 times longer than mine.
But thanks, i’ll take a look at it.