Picking a single RED value, and all the G and B (0-255)
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Picking a single RED value, and all the G and B (0-255)
Yes, my mistake. User snibgo is correct.
Re: Picking a single RED value, and all the G and B (0-255)
Ok awesome...and thanks again to both of you...I was waiting to see which one of you was correctfmw42 wrote:Yes, my mistake. User snibgo is 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)
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.)
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.)
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Picking a single RED value, and all the G and B (0-255)
It works fine for me. For example:
Values at 216 and below are turned black.
Please show your input and output images.
Code: Select all
f:\web\im>%IM%convert -size 1x256 gradient:black-white -fill Black -fuzz 15% +opaque gray(255) txt:
Please show your input and output images.
snibgo's IM pages: im.snibgo.com
Re: Picking a single RED value, and all the G and B (0-255)
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?
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)
EDIT: This might be an error on my side...more to come...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?
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)
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
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
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Picking a single RED value, and all the G and B (0-255)
In your cmd/BAT file, you have correctly doubled the % sign in %%x. Why haven't you doubled it in "15%"?
snibgo's IM pages: im.snibgo.com
Re: Picking a single RED value, and all the G and B (0-255)
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:snibgo wrote:In your cmd/BAT file, you have correctly doubled the % sign in %%x. Why haven't you doubled it in "15%"?
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