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

FFmpeg trac at avcodec.org
Tue Apr 26 12:28:33 EEST 2022


#9750: overlay filter alpha premultiplied performs brighter on transparent images
------------------------------------+------------------------------------
             Reporter:  windowsair  |                    Owner:  (none)
                 Type:  defect      |                   Status:  new
             Priority:  normal      |                Component:  avfilter
              Version:  git-master  |               Resolution:
             Keywords:              |               Blocked By:
             Blocking:              |  Reproduced by developer:  0
Analyzed by developer:  0           |
------------------------------------+------------------------------------
Comment (by windowsair):

 Replying to [comment:3 Elon Musk]:
 > Are you sure this is not your wrong use of filters.
 >
 > For example what happens if you change overlay parameter to not use
 default yuv colorspace.

 Here I want to provide you with more specific test steps and results
 comparison charts to explain the problem. My original input is a picture
 in the RGBA8888 format, which is represented by "a.hex". Among them,
 4byte's 0x00, 0x00, 0x00, 0x00 represents completely transparent black.

 I use the following command:
 {{{
 ffmpeg.exe  -i a1.mp4 -f rawvideo -s 1920x540 -pix_fmt rgba -i a.hex
 -filter_complex "[0:v][1:v]overlay=x=0:y=0:alpha=premultiplied[v]" -map
 "[v]"  -c:v:0 libx264 -f mp4  output.mp4
 }}}

 Similarly, I test the following three cases in total.
 1. alpha=premultiplied
 2. alpha=premultiplied:format=yuv420p10
 3. alpha=straight


 Test Result:
 [[Image(https://trac.ffmpeg.org/raw-attachment/ticket/9750/compare.png)]]
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/9750#comment:5>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list