Custom G'MIC script not working

scripting
gmic

(David Tschumperlé) #21

This might be related to the presence of an alpha channel, I’ll check that asap.


(dumb) #22

I tested an image without an alpha channel and it still didn’t work. Strangely, after I rebuilt the script, it works again with the only exception being that whenever I use a specified channel in the warp loop with plasma texture generation turned on, the image turns into a wall of alpha.


(dumb) #23

Never mind, I fixed that too. The error persists.


(dumb) #24

Fully working; I fixed the business with the alpha channel.

(edited twice because ‘initial’ script had another defect and the ‘second’ one had yet another)


(David Tschumperlé) #25

Updated.


(dumb) #26

Cool, though it would be nice to have an alpha channel for the quadtree filter. I have no idea how that filter works but I know that it doesn’t use alpha channels; even removing the -to_rgb option doesn’t add that.


(dumb) #27

I have another idea, though it would require layer creation and blending:and then enters a loop for x new layers for each input layer where after a base layer is warped:

  1. A layer is created from the base layer and is warped using UltraWarp+++ (which may instead use a plasma texture);
  2. A second new layer is filled with white and then a selection within the layer is filled with black;
  3. The second new layer is warped, greyscaled with a mono mixer and given extreme contrast;
  4. The second new layer is used as a layer mask for the first new layer.

At the end there would be an option where the layers are blended using whatever mode.

This would allow me to create extremely-warped, multi-layered textures in a single click, such as this:


(dumb) #28

I’ve updated the main script again and I’ve also been busy trying to sort something out for this; it’s taking me a long time to get this sorted out.

100%,100%,1,3
-fill_color[-1] 255,255,255
100%,100%,1,3
ww=(round($wu))
hh=(round($h
u))
sw=(round($wu))
sh=(round($h
u))
-r[-1] 1,0,$ww,$hh
-fill_color[-1] 0,0,0
-shift[-1] $sw, $sh
-blend[-1,-2]
-ac “-ultrawarpplusplusplus $*”,2,0
-fx_mix_ycbcr 4,0,0,0,0,0,0,0,0,0,2,0
-fx_mix_ycbcr 50,1,0,0,0,0,0,0,0,0,2,0

What I want is something like this, which I can use as a layer mask like in GIMP:


#29

Not sure exactly what you want, but assuming colour to black & white you probably need a threshold of some sort. Something like “-norm -gt 50% -* 255” perhaps. Maybe some of these commands are relevant: -threshold, -inrange, -otsu. The G’MIC reference is your friend!


(dumb) #30

That’s cool; I’m now using that instead of the seemingly-arbitrary mixer commands. I need to find out how to use it as a layer mask.


(dumb) #31

I have another problem, namely the fact that some of the parameters don’t randomise for each layer in a stack of layers in G’MIC for GIMP, namely everything besides whatever’s in the warping loop. I’ve tried to use -srand and it doesn’t work; while it works fine on the top layer, it doesn’t work on any other layer. The script now looks like this.


(dumb) #32

Tried to attack these problem again, no luck. I simply cannot get random results on multiple images or get the multi-warpingn layer-mask thing to work. I don’t know how to do either.