Link to home
Start Free TrialLog in
Avatar of jean ala
jean alaFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Simple Image processing questions

Hello

A coloured image has 3 values (R,G,B) so how the three values are stored in the matrix?

1-My understanding is that in every cell of the matrix, there is one value so I am wondering how Jpeg for example store the three values?
2-If I have an image and I would like to see the whole matrix (all the colour values) is there a program that convert the image to a text file hat has all the colour values of the image?

Thank you
Avatar of David Favor
David Favor
Flag of United States of America image

1) https://en.wikipedia.org/wiki/JPEG_File_Interchange_Format provides a good starting point for exploring the actual on disk format.

2) To dump the internal format of a JPEG image produces as massive amount of data + require a good bit of time to dump...

ImageMagick is likely the best all round tool to dump all images in various formats. During the dump, 1x CPU will spin at 100%. For example...

# time convert /var/www/html/test/roastedsweetpotato9.jpg -unique-colors -depth 16 txt:- | wc -l
17,915,905

real	4m35.410s
user	4m36.704s
sys	0m7.602s

Open in new window


Output data will be many lines of the form...
... ... ...
982,23: (1285,771,1028)  #050503030404  srgb(5,3,4)
983,23: (2313,2056,1028)  #090908080404  srgb(9,8,4)
984,23: (2056,1799,1285)  #080807070505  srgb(8,7,5)
985,23: (1542,1028,1285)  #060604040505  srgb(6,4,5)
986,23: (2313,1285,1028)  #090905050404  srgb(9,5,4)
987,23: (2570,2313,1285)  #0A0A09090505  srgb(10,9,5)
... ... ...

Open in new window


So it's easy to dump the data of an image + I'm unsure what you'd do with the results.
ASKER CERTIFIED SOLUTION
Avatar of Dr. Klahn
Dr. Klahn

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial