Using 'thickcircle' command correctly.

I have been trying to get the thickcircle command to work, but have had no luck so far, with:

gmic 1280,800,1,3 thickcircle 50%,50%,20,0.7,130 o output.png

I get the error:

[gmic] *** Error in ./thickcircle/ *** Command 'e': Invalid selection '[0--3]' (contains index -3, not in range -2...1).

I have tried creating a greyscale, RGB and RGBA image to associate with the command, but to no avail.

I’m taking the command structure from: https://gmic.eu/reference/thickcircle.html#top - so I assume it’s ok syntax-wise?

I have used the following versions:

Version 3.6.6
Version 3.7.0 (pre-release #26011321)
Version 3.7.0 (pre-release #26012409)
Version 3.7.0 (pre-release #26020609)

With Android proot-distro instances of Ubuntu and Deepin.

All to no avail. The regular circle command works fine though.

I get the same error. It is actually a bug in the G’MIC stdlib which I fixed with:

So, with G’MIC 3.7.0, you should be able to get the fix with $ gmic update.
This being said, even with the fix, wiith your command, I get a black image.

But,

$ gmic h thickcircle

  thickcircle:
      x[%],y[%],R[%],_thickness>=0,_opacity,_color1,...

    Draw specified colored thick outlined circle on selected images.

    Default values: 'thickness=3', 'opacity=1' and 'color1=0'.

    Example:
      [#1] 400,400 repeat 15 { R:=lerp(10,190,$%) thickcircle 200,200,$R,2,1,$R } n 0,255 map 7

and in your command you specified arguments :

thickcircle 50%,50%,20,0.7,130

which means a thickness of 0.7. This is less than 1px…
Specifying a reasonnable thickness (and here an opacity of 0.7), like:

thickcircle 50%,50%,20,7,0.7,130

I get something that looks good:

1 Like

Ah, of course, for some reason I thought 0.7 was in the position for opacity…:confounded:
Glad you were able to fix it, thanks! :grin:

1 Like

You are also missing an argument here, so even with a thickness of 10 it doesn’t really work because it sends an opacity of 130 and color 0, so, black on black.

[gmic]./ Draw thick outlined circle at (50%,50%) with radius 20 on image [0], with thickness 10, opacity 130 and color (0).

this will work though : thickcircle 50%,50%,20,10,,130
because by adding a coma you are actually skipping 1 parameter (Opacity) that CAN fall back to it’s default. (Not all parameters have defaults though).
Color can also have 3 values R,G,B but you already know that :slight_smile:

@prawnsushi OK got it thanks (didn’t know about the comma trick, interesting!)
Yes, when David pointed out the command was malformed, I quickly saw the error of my ways and modified my commands… I was combining thickcircle’s with the gcd_warpmap command to get certain effects and then using the result and adding it as a layer in another instance of the Warp Map command to come up with a distorted bunch of shapes.
So a typical line would be:
gmic v 0 1280,800,1,3 thickcircle 3%,15%,462,11,0.7,163,147,131 thickcircle 14%,12.95%,85.5,12,0.9,190,56,26 thickcircle 78.5%,48.5%,481,11.2,0.7,56,45,17 rft2.png gcd_warpmap 23,1.3,5.8,0,0 o in4_0539.png
…and I’d then use the result in a command like:
gmic v 0 in4_0539.png rft2.png gcd_warpmap 14,7.5,0,0,0 o out2_0539.png (with the Warp Map command now not having any smoothing)
The ‘rft2.png’ image was something made by the ‘Thorn Fractal - Secant Sea’ filter (gui_rep_tfrac) … so I did a bunch of these and made a little abstract video.

I have also recently used your very own “Sketchy Ellipses” filter to make some little videos, then I had the idea of doing 2 (or 3?) similar videos and blending them together with ffmpeg, and I got this:

So, thanks for making the filter(s) :wink:

2 Likes

This talk of fixes reminds me, I never posted that Blur [Bloom Glare] stopped working, but interestingly Blur [Bloom] still works.

*** Error in ./fx_blur_bloom_glare/ *** Command ‘input’: File ‘0’, format does not take any input options (options ‘+,max,min}’ specified).

And it’s one of David’s filters too, tisk tisk :slight_smile:

It works for me.
Have you refreshed your filters ? What version of G’MIC do you use?

I’m using 3.66 on windows and yes I did an update, and did one right before posting just to be sure.
Funny, often I assume it’s something on my system that is the issue and now when I was (over)confident it wasn’t - it apparently is.
But everything else seems to be working OK though.
And as I said Blur [Bloom] works fine but the Glare version fails (for me), both in the GUI iteration as well as the CLI version.

It’s not super important though since Blur [Bloom] is pretty close, but maybe I’ll run into more filters that fail for me, there are so many.

Edit:
Well, I tried dozens of filters now but no other errors so far.

Just noticed that the output says:
fx_blur_bloom_glare/ Set local variable ‘op=${arg0’.
And I’m wondering, only one { can’t be right can it?
I’m not the professor here, but it looks like it’s possibly related to the recent changes to the arg? Wasn’t there a bulk update of the filters to use arg0 or something?

OK I think I found the issue,
I opened update366.gmic and changed

fx_blur_bloom_glare :
op=${arg0 $4,+,max,min}

to become:

fx_blur_bloom_glare :
op=${“arg0 $4,+,max,min”}

And now there are no errors.

So tell me David, was that the issue? Missing quotation marks
Or did I just fake-fix it with changing the filter to no longer do what it is suppose to do.

Absolutely. You are right.

Such a nice feeling to have something be fixed.
But such a, uh, oddly tense feeling if there is a bug.
Thanks for the quick reply so I know for sure :slight_smile:

1 Like

[gmic] *** Error in ./samj_ripple_houghsketchbw/*foreach/autocrop/*if/*foreach/_autocrop_coords/*foreach/*if/ *** Operator ':=' on variable 'l_value': Invalid right-hand side; Unrecognized item 'sp1,0' in expression 'values = sort(values,0,0,off/(0?2:sp1'.

Using the Version 3.7.0 (pre-release #26020609), haven’t had a chance yet to compile the latest stable version, so maybe it’s fixed there.
Not urgent as I’m using the 3.6.6 version anyway, but thought I’d report it here just in case…

Hi Mushy,
There was a small issue relating to changes to the ispercentage use but David made an alias and now the filter you mentioned works for me, in the GUI version at least.
Link to David’s post:

Yes, I read that, not that I have a clue of its relevance (the internal workings of gmic are a bit beyond my limits of comprehension)!
However, I’m now using the stable version 3.7.0, so not an issue thankfully.

I’m just happy that people far more knowledgeable than me are on the ball when it comes to keeping this brilliant software going.