Opened 4 years ago

Last modified 21 months ago

#3805 reopened enhancement

Transparent png pixels should show the background colour

Reported by: dericed 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 (7)

comment:1 Changed 4 years ago by cehoyos

  • Priority changed from critical to normal

Do you think this is a regression?

comment:2 Changed 4 years ago by cehoyos

  • Resolution set to worksforme
  • Status changed from new to closed

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 Changed 4 years ago by cehoyos

  • Component changed from undetermined to avcodec
  • Priority changed from normal to wish
  • Resolution worksforme deleted
  • Status changed from closed to reopened
  • Summary changed from hash brown decoding error to Transparent png pixels should show the background colour
  • Type changed from defect to enhancement

comment:4 follow-up: Changed 4 years ago by 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.

comment:5 in reply to: ↑ 4 Changed 4 years ago by cehoyos

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 Changed 3 years ago by Underground78

  • Cc underground78@gmail.com added

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

comment:7 Changed 21 months ago by richardpl

  • Component changed from avcodec to ffplay
Note: See TracTickets for help on using tickets.