CRT shaders unwanted scanlines when scaling an image
-
Hi all, I recently discovered a rather unpleasant side effect of using the CRT shaders. It's practically impossible to shrink the size of the resulting screenshots with no artifacts if the shader is already applied.
Imagine you want to make a screenshot inside a retro game or capture a video from an emulator. The video on YouTube or an image on Instagram may not always be displayed in its original size. Also, you often scale videos or screenshots during editing. I sometimes see comments on Reddit that some screenshots have to be shown only in 100% size, because the previews have ugly artifacts with big scanlines, which never appeared on the original image. It's even worse when you apply a curved CRT shader, then your scanlines form curves or even circles, depending on the zoom value.
The following screenshots were made from doxbox-staging with crt-geom.glsl shader (the original image and images scaled to 50%). But in general, it doesn't matter where exactly you capture a screenshot. I have seen the same effect in RetroPie and PCem with different shaders. I tried to reduce the destructive effect of the shader scaling by adding a bit of Gaussian Blur or Lens Blur in advance. It's a bit better, though the image is not as sharp, and the effect is still barely visible.
I have found zero information regarding this effect on the internet. It's more or less clear that shrinking images is a destructive operation, and there is math behind the image resizing that is responsible for image degradation when applied on top of the shader. But do you maybe have any practical advice, how to minimize this effect? The answer might be: don't use shaders when capturing, add them during the post-processing phase. But as I said before, the content you produce won't be played in its original size anyway, there is no guarantee. I refuse to believe that people who edit videos or stream retro games have never seen these artifacts before.
Thank you in advance for your help.
-
The original image. Edit: the original image was too big, so I had to attach half of it. Converting it to JPEG added the artifacts as well.
-
50% shrunk image with cubic interpolation
-
50% shrunk image with no interpolation
-
50% shrunk image with cubic interpolation, but lens blur applied before resizing
-
-
OBS Studio (video capture tool) adds this strange, unwanted scanline effect right away, which is even more annoying. It might be related to the encoder settings, and I basically have no idea how to get rid of it. The game itself and the CRT shader looked perfect on screen. The curved lines were added after I captured it. This can be seen in the video from my channel.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.