Page 3 of 3

Re: Picking a single RED value, and all the G and B (0-255)

Posted: 2015-10-18T14:50:12-07:00
by fmw42
Yes, my mistake. User snibgo is correct.

Re: Picking a single RED value, and all the G and B (0-255)

Posted: 2015-10-18T15:43:03-07:00
by gaylorr
fmw42 wrote:Yes, my mistake. User snibgo is correct.
Ok awesome...and thanks again to both of you...I was waiting to see which one of you was correct ;-)

I figured that conversation would happen.

I'm really liking this software....

Re: Picking a single RED value, and all the G and B (0-255)

Posted: 2015-10-26T08:33:05-07:00
by gaylorr
Hmm...I used 15% and it did not get the values I expected it to pick up.

In this case I wanted to grab the roof polygons of the 3D model...represented in this situation as a value of 255 (out of R=0-255):

convert filename.tif -channel r -separate +channel -fill black -fuzz 15% +opaque "gray(255)" -fill white -opaque "gray(255)" ./roofs/filename.tif

I expected it to pick up 255 -+ the fuzz (38.25)...since there are no values of R > 255 I figured it would grab R values from 217 - 255...but it did not...

In my images, it only seemed to pick up from around 241 - 255 (missing values of 228 being the lowest that I find that it should have picked up.)

Re: Picking a single RED value, and all the G and B (0-255)

Posted: 2015-10-26T09:06:51-07:00
by snibgo
It works fine for me. For example:

Code: Select all

f:\web\im>%IM%convert -size 1x256 gradient:black-white -fill Black -fuzz 15% +opaque gray(255) txt:
Values at 216 and below are turned black.

Please show your input and output images.

Re: Picking a single RED value, and all the G and B (0-255)

Posted: 2015-10-26T09:34:05-07:00
by gaylorr
well...I figured it out, but I am not sure what to do to fix it...

If I use a single command like, it does "15%" , if I use it in a string of other commands (other images) in a .cmd file (windows) it sees it as "15"
using Beyond Compare, I checked the 2 outputs...1 from direct command line prompt, and one in a .cmd file by itself.

Is this a known issue?

Re: Picking a single RED value, and all the G and B (0-255)

Posted: 2015-10-26T09:35:43-07:00
by gaylorr
gaylorr wrote:well...I figured it out, but I am not sure what to do to fix it...

If I use a single command like, it does "15%" , if I use it in a string of other commands (other images) in a .cmd file (windows) it sees it as "15"
using Beyond Compare, I checked the 2 outputs...1 from direct command line prompt, and one in a .cmd file by itself.

Is this a known issue?
EDIT: This might be an error on my side...more to come...

Nope...double-checked...when in .cmd file, it gets executed as "15" not "15%"

Re: Picking a single RED value, and all the G and B (0-255)

Posted: 2015-10-26T09:49:05-07:00
by gaylorr
I tried to do something like this with my list of commands, but all the symbols are jacking it up I think:

for %%x in (*.tif) do convert %%x -channel r -separate +channel -fill black -fuzz 15% +opaque "gray(255)" -fill white -opaque "gray(255)" ./roofs/%%x

Re: Picking a single RED value, and all the G and B (0-255)

Posted: 2015-10-26T09:54:51-07:00
by snibgo
In your cmd/BAT file, you have correctly doubled the % sign in %%x. Why haven't you doubled it in "15%"?

Re: Picking a single RED value, and all the G and B (0-255)

Posted: 2015-10-26T10:04:40-07:00
by gaylorr
snibgo wrote:In your cmd/BAT file, you have correctly doubled the % sign in %%x. Why haven't you doubled it in "15%"?
Yep...I just found that in another post...I've been tryin to do that research first, but didn't find it until just now:

viewtopic.php?f=1&t=28433&p=126254&hili ... es#p126254

But thank you...that seems to have worked!

convert filename.tif -channel r -separate +channel -fill black -fuzz 15%% +opaque "gray(255)" -fill white -opaque "gray(255)" ./roofs/filename_15pct-script.tif