a C wrapper library to load image files
#define IMAGE_IMP
#include "image/image.h"
#include <stdio.h>
int
main(void) {
Image *img = load_image("cats.png");
if(!img)
return 1;
printf("width: %d\n", img->w);
printf("height: %d\n", img->h);
printf("first pixels RGB value is: %06x\n", img->bitmap[0] & img->bitmap[1] << 8 & img->bitmap[2] << 16);
return 0;
}
link with
cc main.c -lpng -lwebp -lturbojpeg
dependencies:
- libpng
- libwebp
- libturbojpeg