...
So, for 1, will I need to import all the image pixel values into an array / matrix?
Thank you
P.S. I'm really not a good programmer and this is going to be a big learning curve to take slowly over the next 3 weeks.
Hello,
I'm not really into image processing, but the above question seems to have an obvious (positive) answer. Unless of course you later need to do some more advanced stuff, in which case a raw array of "pixels" wouldn't be really helpful.
For example, you will probably need to know each pixel's position (either absolute or as an offset) its current color (usually expressed as RGB bytes), and stuff like that.
I don't know what's the industry standard for storing pixels, but representing a pixel entity as a
struct, say...
typedef struct Pixel {...}Pixel;
consisting of all the fields needed for any individual pixel, and then use a buffer for storing all your image's pixels...
Pixel *image = malloc( npixels * sizeof(Pixel) );
...
// do what you have to do here
...
if ( image )
free( image ); // free memory reserved for your image, before program termination
exit( EXIT_SUCCESS);
seems to me like a promising idea.
To obtain the required number of pixels, decompression directives, color formatting, etc you should read your image file's
header, which differs among different image formats. I suppose your teacher have explicitly explained the format of the images he wants you to manipulate.