It is currently Fri Jul 26, 2024 7:21 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 24 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Does multi-threshold exists? (G'MIC help)
PostPosted: Tue Aug 23, 2016 9:10 pm  (#21) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4041
Location: Canada
I have been hacking away at this without luck.
So I got 2 thresholds to work.
but trying to set Alpha if Red is is equal to 255 and it doesn't seem to do anything.
any pointers?
#@gmic
#@gimp <b>.{development filters}</b>

#@gimp Multi Thresholds : multi_threshold, multi_threshold
#@gimp : Threshold1 = int(20,1,256)
#@gimp : Threshold2 = int(20,1,256)
multi_threshold :
   --luminance[0] -threshold[-1] $1 -normalize[-1] 0,255 -to_colormode[-1] 4 -if {R==255} A=0 -endif
   --luminance[0] -threshold[-1] $2 -normalize[-1] 0,255
   
   
#@gimp _

_________________
TinT


Top
 Post subject: Re: Does multi-threshold exists? (G'MIC help)
PostPosted: Wed Aug 24, 2016 2:12 am  (#22) 
Offline
GimpChat Member

Joined: Sep 24, 2012
Posts: 275
Location: Scotland
Wish I could expand more but here are some pointers:

"Alpha" aka opacity is effectively channel 3 in G'MIC (channels 0-2 being RGB if we're treating the image as an RGBA, note G'MIC itself makes no distinction about what's in the channels - only that it has them).

You can split the channels of a 3 channel image to separate images using -split[-1] c and rejoin with -append[-3--1] c.
So if we have an image which is RGB and want to make a 4th channel where R=255:

-split[-1] c --eq[-3] 255 -append[-4--1] c


Note there are faster/more memory efficient ways of doing this but best to start simple.

Some other commands which may be relevant to your task (not saying you should be limited to them!):
-gt -lt -inrange -tones -quantize -equalize -select_color


Top
 Post subject: Re: Does multi-threshold exists? (G'MIC help)
PostPosted: Wed Aug 24, 2016 12:08 pm  (#23) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4041
Location: Canada
I got it to work...
it's not perfect as i think there might be other efficient ways of doing it. but
I got it to work that's the important part...a little slow on refresh hehehe.

_________________
TinT


Top
 Post subject: Re: Does multi-threshold exists? (G'MIC help) SOLVED.
PostPosted: Wed Aug 24, 2016 6:27 pm  (#24) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4041
Location: Canada
Thanks for GarageCoder for getting me started.
This is solved here

_________________
TinT


Top
Post new topic Reply to topic  [ 24 posts ]  Go to page Previous  1, 2

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Palette from multi image

2

No new posts Attachment(s) Seeking Help with First Multi-File Batch Script

9



* Login  



Powered by phpBB3 © phpBB Group