[vlc-commits] PNG: Modify color correction application to fix semi-transparent pixels

Diogo Silva git at videolan.org
Thu Apr 20 09:55:07 CEST 2017


vlc | branch: master | Diogo Silva <dbtdsilva at gmail.com> | Sat Apr 15 16:32:16 2017 +0100| [e8d5548488165398105292b68b745b057def237a] | committer: Jean-Baptiste Kempf

PNG: Modify color correction application to fix semi-transparent pixels

Improved color correction by replacing PNG_ALPHA_STANDARD with
PNG_ALPHA_OPTIMIZED and PNG_GAMMA_LINEAR with PNG_DEFAULT_sRGB (was marked
for academic environments).

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e8d5548488165398105292b68b745b057def237a
---

 modules/codec/png.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/codec/png.c b/modules/codec/png.c
index 75f3ad440b..da97909bad 100644
--- a/modules/codec/png.c
+++ b/modules/codec/png.c
@@ -262,7 +262,7 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
         i_color_type == PNG_COLOR_TYPE_GRAY_ALPHA )
           png_set_gray_to_rgb( p_png );
     if( i_color_type & PNG_COLOR_MASK_ALPHA )
-        png_set_alpha_mode( p_png, PNG_ALPHA_STANDARD, PNG_GAMMA_LINEAR );
+        png_set_alpha_mode( p_png, PNG_ALPHA_OPTIMIZED, PNG_DEFAULT_sRGB );
 
     /* Strip to 8 bits per channel */
     if( i_bit_depth == 16 ) png_set_strip_16( p_png );



More information about the vlc-commits mailing list