Opened 10 years ago

Closed 3 years ago

#3805 closed enhancement (fixed)

Transparent png pixels should show the background colour

Reported by: dave rice Owned by:
Priority: wish Component: ffplay
Version: git-master Keywords: png
Cc: underground78@gmail.com Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
The official digital portrait of the McDonald's hash brown decodes incorrectly in ffmpeg adding distorted orange colors. The png is here: http://www.mcdonalds.com/content/dam/McDonalds/item/mcdonalds-Hash-Brown.png.

How to reproduce:

ffplay http://www.mcdonalds.com/content/dam/McDonalds/item/mcdonalds-Hash-Brown.png
ffplay version N-64536-gc8b2cf4 Copyright (c) 2003-2014 the FFmpeg developers
  built on Jul  8 2014 23:01:07 with Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libfreetype --enable-ffplay --enable-libopenjpeg --extra-cflags='-I/usr/local/Cellar/openjpeg/1.5.1_1/include/openjpeg-1.5 '
  libavutil      52. 91.100 / 52. 91.100
  libavcodec     55. 68.102 / 55. 68.102
  libavformat    55. 45.100 / 55. 45.100
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 10.100 /  4. 10.100
  libavresample   1.  3.  0 /  1.  3.  0
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
Input #0, image2, from 'http://www.mcdonalds.com/content/dam/McDonalds/item/mcdonalds-Hash-Brown.png':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: png, rgba, 444x320 [SAR 2835:2835 DAR 111:80], 25 tbr, 25 tbn, 25 tbc
   0.67 M-V:  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0 

Change History (8)

comment:1 by Carl Eugen Hoyos, 10 years ago

Priority: criticalnormal

Do you think this is a regression?

comment:2 by Carl Eugen Hoyos, 10 years ago

Resolution: worksforme
Status: newclosed

ffplay - and ffmpeg without additional options - cannot (and to the best if my knowledge will not) display transparency, the following works fine:

$ ffmpeg -f lavfi -i color=white:s=444x320 -i mcdonalds-Hash-Brown.png -filter_complex overlay -vframes 1 out.jpg

I consider the image slightly broken, I don't think transparent parts of an image should be masked out by the decoder.

comment:3 by Carl Eugen Hoyos, 10 years ago

Component: undeterminedavcodec
Priority: normalwish
Resolution: worksforme
Status: closedreopened
Summary: hash brown decoding errorTransparent png pixels should show the background colour
Type: defectenhancement

comment:4 by Christophe, 10 years ago

ffmpeg doesn't parse the bKGB chunk that contains this information as indeed you can't have both transparency and a background at the same time in ffmpeg.

in reply to:  4 comment:5 by Carl Eugen Hoyos, 10 years ago

Replying to kurosu:

ffmpeg doesn't parse the bKGB chunk that contains this information as indeed you can't have both transparency and a background at the same time in ffmpeg.

Yes but the sample in question does not contain a bKGB chunk and is still displayed better by many / all other programs that support displaying png.

comment:6 by Underground78, 9 years ago

Cc: underground78@gmail.com added

Seems like the same issue is reproducible with this image which looks like this in ffmpeg.

comment:7 by Elon Musk, 7 years ago

Component: avcodecffplay

comment:8 by Elon Musk, 3 years ago

Resolution: fixed
Status: reopenedclosed

Can no longer reproduce with mpv/ffplay.

Note: See TracTickets for help on using tickets.