Feature request: invoke command for each pixel
Posted: 2014-09-08T08:49:30-07:00
Hi.
I wonder if this is already solved, i can't find myself anything relevant.
I need a command-line way to divide image by pixels, and for each enumerated pixel started from (0,0) execute custom (my) command and pass parameters to it: x, y, r, g, b, h, s, v, alpha.
Something like
and if i feed image say 3 by 2 pixels and first pixel is red, 2nd is green, and 4 others are white, i should get six executed commands:
This will become only cross-platform way to prepare .prn files for dot matrix printers, PCB files labeling/imaging, etc.
I already have my own simple parser, but it work only with RAW images.
And most important, this looks like not so hard to implement.
Thanks so much!
I wonder if this is already solved, i can't find myself anything relevant.
I need a command-line way to divide image by pixels, and for each enumerated pixel started from (0,0) execute custom (my) command and pass parameters to it: x, y, r, g, b, h, s, v, alpha.
Something like
Code: Select all
convert --divide-and-execute "my.sh"
Code: Select all
my.sh 0 0 255 0 0 0 100 100 100
my.sh 1 0 0 255 0 120 100 100 100
my.sh 2 0 255 255 255 0 0 100 100
my.sh 0 1 255 255 255 0 0 100 100
my.sh 1 1 255 255 255 0 0 100 100
my.sh 2 1 255 255 255 0 0 100 100
I already have my own simple parser, but it work only with RAW images.
And most important, this looks like not so hard to implement.
Thanks so much!