[vlc-devel] [PATCH] PNG: Sligtly modified how the color correction is applied (it fixes semi-transparent pixels)

Francois Cartegnie fcvlcdev at free.fr
Fri Jul 27 11:14:38 CEST 2018


Le 15/04/2017 à 17:32, Diogo Silva a écrit :
> 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).
> 
> ---
>  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 );
> 

This is incorrect compared to the previous value, and creates saturation
problems in SPU blending.

-- 
Francois Cartegnie
VideoLAN - VLC Developer


More information about the vlc-devel mailing list