image_readers: premultiply alpha

This commit is contained in:
artemp
2014-11-21 11:28:56 +01:00
parent 1e9b6611cc
commit 4af232dcf3
2 changed files with 2 additions and 1 deletions

View File

@@ -157,6 +157,7 @@ void png_reader<T>::read(unsigned x0, unsigned y0, unsigned w, unsigned h, char
double gamma;
if (png_get_gAMA(png_ptr, info_ptr, &gamma))
png_set_gamma(png_ptr, 2.2, gamma);
png_set_alpha_mode(png_ptr, PNG_ALPHA_PREMULTIPLIED, 2.2);
if (x0 == 0 && y0 == 0 && w >= width_ && h >= height_)
{