[FFmpeg-trac] #9750(avfilter:new): overlay filter alpha premultiplied performs brighter on transparent images

FFmpeg trac at avcodec.org
Tue Apr 26 06:20:16 EEST 2022


#9750: overlay filter alpha premultiplied performs brighter on transparent images
------------------------------------+--------------------------------------
             Reporter:  windowsair  |                     Type:  defect
               Status:  new         |                 Priority:  normal
            Component:  avfilter    |                  Version:  git-master
             Keywords:              |               Blocked By:
             Blocking:              |  Reproduced by developer:  0
Analyzed by developer:  0           |
------------------------------------+--------------------------------------
 == Summary of the bug:

 I'm using ffmpeg's overlay filter with alpha premultiplied parameter. I
 noticed that when a completely transparent image was overlay to the
 background video, the output video was much brighter.

 In the following demo, I will use RGBA8888 format images for overlay. Its
 use of RGBA (255,255,255,255,0) indicates full transparency (aka
 completely transparent white), and the result demonstrates a very
 noticeable brightening (the expected result should be unchanged, since the
 image is completely transparent).

 ps: Using RGBA (0,0,0,0) (aka completely transparent black) also results
 in a brightened image.

 == How to reproduce:
 {{{
 % ffmpeg.exe  -loglevel debug -i a1.mp4 -i a1.png -filter_complex
 "[0:v][1:v]overlay=x=0:y=0:alpha=premultiplied[v]" -map "[v]"  -c:v:0
 libx264 -f mp4  output.mp4
 }}}

 == ffmpeg output
 {{{
 ffmpeg version n5.0.1-3-gb655beb025-20220425 Copyright (c) 2000-2022 the
 FFmpeg developers
   built with gcc 11.2.0 (crosstool-NG 1.24.0.533_681aaef)
   configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static
 --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64
 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug
 --enable-shared --disable-static --disable-w32threads --enable-pthreads
 --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype
 --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig
 --enable-libvorbis --enable-opencl --disable-libpulse --enable-libvmaf
 --disable-libxcb --disable-xlib --enable-amf --enable-libaom --enable-
 avisynth --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac
 --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme
 --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus
 --enable-librist --enable-libtheora --enable-libvpx --enable-libwebp
 --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-
 libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-
 libopenmpt --enable-librav1e --enable-librubberband --enable-schannel
 --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1
 --enable-libtwolame --enable-libuavs3d --disable-libdrm --disable-vaapi
 --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-
 libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-
 libxvid --enable-libzimg --enable-libzvbi --extra-
 cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread
 --extra-ldexeflags= --extra-libs=-lgomp --extra-version=20220425
   libavutil      57. 17.100 / 57. 17.100
   libavcodec     59. 18.100 / 59. 18.100
   libavformat    59. 16.100 / 59. 16.100
   libavdevice    59.  4.100 / 59.  4.100
   libavfilter     8. 24.100 /  8. 24.100
   libswscale      6.  4.100 /  6.  4.100
   libswresample   4.  3.100 /  4.  3.100
   libpostproc    56.  3.100 / 56.  3.100
 }}}

 The complete output is given in the file ffmpeg.log
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/9750>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list