Topic: Converting bitmaps to text
I've got an unusual scripting challenge that I am hoping can be solved by a bit of ruby..
I have a series of large (at least 3000x3000px, could be double or triple that) bitmaps that need to be "dissected", pixel by pixel, and based on a colour key, converted into values (for eventual import into a SQL database).
So I need to get into a CSV or similar file:
- the X & Y pixel coordinate (should be easy enough if I know the exact pixel width of the image)
- the RGB colour value of the pixel and convert (could be one of <50 values) based on a key (this bit can be done later).
IIRC, the bitmap format contains all of these in sets of three values for each pixel anyway - so I don't think it should be too difficult.
Just looking for any tips/pointers to guides, snippets of code or suggestions - not sure where to start with this having never seen anything like it!