I need a faster way to generate locations of white pixels
Posted: 2013-09-29T12:16:56-07:00
I need to display the locations of all the white pixels in my monochrome PNG file (i.e., identify reports it as: trythis3.png PNG 769x550 769x550+0+0 8-bit sRGB 2c 6.14KB 0.000u 0:00.000). I've got something that works: "convert trythis3.png sparse-color:- | tr ' ' '\n' | grep white" but I find it to take about 3 seconds per file which I think is slower than it needs to be. I read somewhere that there is a preferred (and faster) way to generate the information but I can't remember the other method. Basically I need the X,Y locations of all the white pixels. Like this:
10,11
12,13
1500,2021
Once again thanks to the author of this spectacular program.
10,11
12,13
1500,2021
Once again thanks to the author of this spectacular program.