Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Top Layer of Camo Generator Transparent?
#1
Hello All,

I was excited to see GIMP supports Scheme so I took a crack at generating some procedural camouflage.
Overall it was easy and I'm happy with my effect.
There seems to be one slight error and that is that my topmost layer seems to be drawn transparent if you use my default colors when running the script.
To run the script open a fresh blank image and then select the script.
[Image: LRU0DWp.png]


My code is here:
https://github.com/RyanBurnside/gimp-cam...n/camo.scm

The xcf image in question I'll attach.

If you disable all layers except for the first you'll see you can see the checkerboard showing through.

https://imgur.com/LRU0DWp.png


Attached Files
.xcf   camo.xcf (Size: 429.54 KB / Downloads: 187)
Reply
#2
Strange Indeed,
No programmer here, just reporting what I experienced
Line 13: I did put 23 instead of 22 and no more transparency... (I tried with the number 3 instead of 2 on the last argument ➤ still transparency)

   

Also your script is not able to be called back with CtrL+F / Shift+Ctrl+F if we use it first, we need to use another filter/script, then we will be able to call it back in the Filters ➤ Recently used and then we can do a Ctrl+F

   
Reply
#3
Problem doesn't appear if your layer has a color different from black. In fact you use black in other layers, they are left completely transparent.This is because you do a selection on black before the cut....

But your process is contrived, so summarize:
  • generate random black and white pattern with solid noise+threshold
  • replace white with color
  • get a selection on black
  • cut out the black and leave the color
It is simpler/faster (and doesn't leave you with a stickiness on black) to:

  • generate random black and white pattern with solid noise+threshold
  • make it a selection
  • bucket fill the layer with chosen color

This is easy if you add a channel, apply the solid-noise+threshold on it, then get a selection from it with gimp-image-select-item. The channel can be re-used for all layers.
Reply
#4
@PixLab I'll check into this.

@Ofnuts
Thank you!
I will try the alternative suggestion though when I get a chance, maybe tomorrow. (Work has been taking my time today)

Is there a bug in the wrapper though? I guess I'm not 100% clear on that.
Reply


Forum Jump: