Programmatic access to image attributes
Posted: 24.05.2009, 12:31
Hi,
Does anyone know if any of the common tools such as The GIMP are able to decode/extract the coordinate and color attributes of an image (either greyscale, RGB, or CMYK) into say a CSV file.
I could then access the values programmatically in a spreadsheet. ie. I could make programming decisions based on the color value of a given pixel coordinate.
To take a very simple example, let's say I had a 16 pixel image which looked like this:
...if the format of the output CSV file is: X,Y,R,G,B, then I might expect to get a file containing something like:
Cheers
CC
Does anyone know if any of the common tools such as The GIMP are able to decode/extract the coordinate and color attributes of an image (either greyscale, RGB, or CMYK) into say a CSV file.
I could then access the values programmatically in a spreadsheet. ie. I could make programming decisions based on the color value of a given pixel coordinate.
To take a very simple example, let's say I had a 16 pixel image which looked like this:
...if the format of the output CSV file is: X,Y,R,G,B, then I might expect to get a file containing something like:
Code: Select all
0,0,0,0,0
0,1,64,64,64
0,2,128,128,128
0,3,192,192,192
1,0,255,255,255
1,1,0,0,0
1,2,64,64,64
1,3,128,128,128
2,0,192,192,192
2,1,255,255,255
2,2,0,0,0
2,3,64,64,64
3,0,128,128,128
3,1,192,192,192
3,2,255,255,255
3,3,0,0,0
Cheers
CC