I already have C code that does my task, but it is not cross-platform, and can't work on any image format except straight RAW (and i of course use IM to get RAW from anything, it performs very vell). I probably can add header processing myself to recognize other files, but even better way (and it is what i ask) is glueless method: if IM can do the task in subject, it is all i need. And it is (for me) better than dump raw image to text file.
I am aware that running external script for each pixel is too slow, but it is (in my case) intended to very small images, and runtime not so important.
One example of "my.sh" file is something like this (i am sorry, it is not done yet so i put C equivalent) i.e. it is should processing coordinates and color and fill binary buffer, text file, or so, with data according to coordinates and color:
Code: Select all
fprintf(file2," (line (pt %.2f %.2f) (pt %.2f %.2f) (width %.2f) )\n", pax, pay, pbx, pby, pcblinewidth);
fprintf(file2," (line (pt %.2f %.2f) (pt %.2f %.2f) (width %.2f) )\n", pbx, pby, pcx, pcy, pcblinewidth);
fprintf(file2," (line (pt %.2f %.2f) (pt %.2f %.2f) (width %.2f) )\n", pcx, pcy, pdx, pdy, pcblinewidth);
fprintf(file2," (line (pt %.2f %.2f) (pt %.2f %.2f) (width %.2f) )\n", pdx, pdy, pax, pay, pcblinewidth);
which should give
for each pixel, text output, something like
Code: Select all
(line (pt 25.30 3.00) (pt 25.45 3.00) (width 0.15) )
(line (pt 25.45 3.00) (pt 25.45 3.15) (width 0.15) )
(line (pt 25.45 3.15) (pt 25.30 3.15) (width 0.15) )
(line (pt 25.30 3.15) (pt 25.30 3.00) (width 0.15) )
and finally when put in PCB file, it looks like this automatic stamping (when finished in vector Gerber and ready to production):
Thanks.