Color on edges of text/masks/etc

I figured out that there are a few reasons why this occurs and is different than GIMP: colorspace conversion, chroma subsampling, and non-linear color processing. The reasons combine to worsen the result.

  1. Start with a test project consisting only of RGB sources and filters. Here is mine
    shotcut bug 21255.mlt (8.8 KB)
  2. Export it with preset FFV1 but in the Other tab change pix_fmt=bgr0 to export it as RGB.
  3. Use VLC to playback the result and export frames as PNG.
    Do not use Shotcut with Video Zoom scope as the player converts everything to YUV 4:2:0 for more effecient playback through OpenGL.
  4. Open the PNG and zoom in.
    Do not use Shotcut’s File > Export Frame… because that comes from the player

For the ellipse made using Mask: Simple Shape
image
No unwanted colors (this filter is not anti-aliased and only provides softness.)

Repeat the above procedure with pix_fmt=yuv444p and mlt_image_format=rgb24 (colorspace conversion with no chroma subsampling):
image

Still looks perfect because we told MLT to render to RGB instead of YUV 4:2:2, and the colorspace conversion is fairly accurate with no chroma subsampling.

Repeat the above with FFV1 defaults (pix_fmt=yuv422p and mlt_image_format=yuv422):
image

Here we start to get miscolored pixels because the chroma data is half the resolution (horizontal only) of the luma. We use FFmpeg libswscale for colorspace conversion, and we have tweaked its flags extensively. Upon decoding for playback it must do some interpolation on the chroma, and when colors with gamma mix it produces dark artifacts like this as explained in the following articles:


https://ninedegreesbelow.com/photography/linear-gamma-blur-normal-blend.html
https://blog.johnnovak.net/2016/09/21/what-every-coder-should-know-about-gamma/

Repeat the above procedure using pix_fmt=yuv420p:
image
The situation is worse because now the chroma resolution is half the luma’s both vertically and horizontally.

Nearly all video is delivered as yuv420p and lossy compression gets thrown on top. You cannot really compare real world lossy compressed, chroma subsampled video with lossless RGB images. We do have plans to move to a linear color processing pipeline when we also increase the bitdepth > 8-bit, but that is going to be a lot of work that will take most of 2021. GIMP already uses linear color processing when GEGL is being used.

If you want to start looking at Shotcut’s images through a microscope, do not use its player and export as lossless RGB. This thread is now reduced to lack of linear color processing.

1 Like