How I've though of going about it is to first identify RGB values for all of the pixels and then go through with a tool like MATLAB and pick out the ones that satisfy my criteria. I've found two commands to help with my first step:
- convert test.png output.txt >>> This does exactly what I want, except that (1) it doesn't save the output in a format readable by a program such as MATLAB, and (2) is a bit slow for a large image.
- convert test.png sparse-color: >>> This outputs exactly the information I need (one above provides unnecessary information beyond pixel location and RGB values), except that I can't find a way to generate an output file.
- As far as my goal goes, is there any simpler way of accomplishing this?
- If I want to use the "sparse-color", can I get this output into a file?
- If I want to use either of the two, can I have it formatted as a CSV that other programs may more easily use?
edit: I'm on ImageMagick 7.0.8-10 Q16 x64, Windows 10.