Created
April 30, 2018 15:44
-
-
Save rHermes/1c49f55b75f60f998c125c9aafed640a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define STB_IMAGE_IMPLEMENTATION | |
#include "stb_image.h" | |
#define STB_IMAGE_WRITE_IMPLEMENTATION | |
#include "stb_image_write.h" | |
int main() { | |
int x, y, n; | |
unsigned char *data = stbi_load("testimage.jpg", &x, &y, &n, 3); | |
stbi_write_png("out-image.png", x, y, 3, data, x*3); | |
stbi_image_free(data); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment