// load image with stb_image.h #include #define STB_IMAGE_STATIC #define STB_IMAGE_IMPLEMENTATION #include "stb_image.h" int main(int argc, char *argv[]) { if (argc != 2) { printf("Usage\n\t01_loadimage.exe IN.png"); } auto filename = argv[1]; unsigned char *pixels; int width; int height; int bpp; pixels = stbi_load(filename, &width, &height, &bpp, 0); printf("Image size %d x %d\n", width, height); printf("Image bpp %d\n", bpp); stbi_image_free(pixels); }