diff --git a/src/nanovg.c b/src/nanovg.c index c34eacb..7223e32 100644 --- a/src/nanovg.c +++ b/src/nanovg.c @@ -698,7 +698,10 @@ void nvgFillPaint(struct NVGcontext* ctx, struct NVGpaint paint) int nvgCreateImage(struct NVGcontext* ctx, const char* filename) { int w, h, n, image; - unsigned char* img = stbi_load(filename, &w, &h, &n, 4); + unsigned char* img; + stbi_set_unpremultiply_on_load(1); + stbi_convert_iphone_png_to_rgb(1); + img = stbi_load(filename, &w, &h, &n, 4); if (img == NULL) { // printf("Failed to load %s - %s\n", filename, stbi_failure_reason()); return 0;