Ofcourse you can do it by considering the file format as sequnce of bits/bytes and store the same in an array.
C does not have the high-level routines to read an image file - you have to read the file format and process it yourself.
Reading the file is easy:
FILE *input;
char get_char;
input = fopen("myimage.bmp", "rb");
while((get_char=fgetc(input))!= EOF)
{
...
}
fclose(input);
Reads a file a byte at a time.
For more information refer the link given below.
https://stackoverflow.com/questions/10531884/write-a-jpg-image-file-in-c