I'm trying to write a C++ routine to read a JPEG and convert it into a 100x100 array with values proportional to the color (i.e. red = 100, white = 0).
Does anyone know of a bit of code or at least a resource?
Try imagemagick - they have routines to convert from jpg to bmp. Once in bmp, you can load up your array. Remember that bmp stores its images upside down.
Also, remember that jpg is a compressed format and may not be a very accurate representation of the data.
Alternatively, load it into paint and convert it to bmp first.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.