Skip to content

Instantly share code, notes, and snippets.

@safijari
Created November 30, 2023 14:55
Show Gist options
  • Save safijari/1b936cbbdebe341fbe340bcfecb04450 to your computer and use it in GitHub Desktop.
Save safijari/1b936cbbdebe341fbe340bcfecb04450 to your computer and use it in GitHub Desktop.
Defringing for OLED Steam Deck Samsung Panel

tldr: Fringing happens because the subpixels are not properly aligned. It can be alleviated by "shifting" the underlying data to colocale in the center of the pixel. On the Samsung Panel, a simplistic solution to this is as follows:

green_amt = 0.2
red_amt = 0.4
blue_amt = 0.3
for i in range(1, im.shape[0]-1):
    for j in range(1, im.shape[1]-1):
        green_out[i, j] = green[i, j+1]*(green_amt) + green[i, j]*(1-green_amt)
        red_out[i, j] = red[i, j-1]*(red_amt) + red[i, j]*(1-red_amt)
        blue_out[i, j] = blue[i+1, j]*(blue_amt) + blue[i, j]*(1-blue_amt)
outim[:, :, 1] = green_out

The above ignores that green/red are a bit above the center and blue alternates between being in the left and right. Refinements are possible but for my personal usecases are not necessary at the moment.

@p2ir
Copy link

p2ir commented Apr 22, 2024

No problem, thanks for the quick response! :)

In no mans sky I am mainly seeing the wattage jump up about 3-4w, fps is about the same as I locked it at 50. As for elden ring the frametimes jump quite a lot.. First I thought it is just something funky happening with vsync, but I disabled it through launch options and was still seeing it. The fps is about the same, just the frametimes are more jittery compared to default. But yea, not seeing these issues when injected through reshade. These tests aren't too scientific :D sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment