From 07d784563af19c162945c60562819269e6fc4994 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 20 May 2011 22:16:51 -0600 Subject: Calculate alpha correctly for canvas exports. --- libdimension/png.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libdimension/png.c') diff --git a/libdimension/png.c b/libdimension/png.c index 3920e7e..5b7f625 100644 --- a/libdimension/png.c +++ b/libdimension/png.c @@ -64,7 +64,7 @@ dmnsn_png_optimizer_fn(const dmnsn_canvas *canvas, dmnsn_color color; uint16_t *pixel = (uint16_t *)optimizer.ptr + 4*(y*canvas->width + x); - color = dmnsn_get_pixel(canvas, x, y); + color = dmnsn_remove_filter(dmnsn_get_pixel(canvas, x, y)); /* Saturate R, G, and B to [0, UINT16_MAX] */ @@ -271,6 +271,7 @@ dmnsn_png_write_canvas_thread(void *ptr) for (size_t x = 0; x < width; ++x) { /* Invert the rows. PNG coordinates are fourth quadrant. */ dmnsn_color color = dmnsn_get_pixel(payload->canvas, x, height - y - 1); + color = dmnsn_remove_filter(color); /* Saturate R, G, and B to [0, UINT16_MAX] */ -- cgit v1.2.3