RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    CRT shaders unwanted scanlines when scaling an image

    Scheduled Pinned Locked Moved Help and Support
    shaderscrtartifactsvideo editing
    2 Posts 1 Posters 75 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • megaJekanM
      megaJekan
      last edited by megaJekan

      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.

      1. 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.
        01_crt-geom_original_half.png

      2. 50% shrunk image with cubic interpolation
        02_crt-geom_scaled50_cubic.png

      3. 50% shrunk image with no interpolation
        03_crt-geom_scaled50_nointerpolation.png

      4. 50% shrunk image with cubic interpolation, but lens blur applied before resizing
        04_crt-geom_lens_blur_scaled50.png

      megaJekanM 1 Reply Last reply Reply Quote 0
      • megaJekanM
        megaJekan @megaJekan
        last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post

        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.