New Scale Filtering mode: Area-Averaging

rcdrone

New Member
Hello,

I'd like to propose adding another Scale Filtering mode. To illustrate, I've attached an image of Link examples where he is upscaled from 256x240 to 1317x1080.

- The Point filter results in a noticeable change in the thickness of Link's shield depending on his pixel position.
- The Bilinear filter provides a consistent thickness, but heavily blurs the image. (Bicubic and Lanczos also hate edges.)
- The "Area" filter is able to provide a consistent thickness without completely smearing the image.

The filter is simple; it's just an average of contributing pixels weighted by their coverage area, so I'd think it'd work decently in both directions. I have a proof-of-concept coded up for OBS although it should probably be handed off to someone more familiar with the code base: only tested with D3D11, gamma-handling incorrect for YUV path, shader probably inefficient, UI localization, etc.

Let me know if you would be interested.

Thanks!
 

Attachments

  • link_scaling.png
    link_scaling.png
    49.9 KB · Views: 3,059
Last edited:

rcdrone

New Member
Exported with git diff. Let me know if you want the code in some other form; I'm not very familiar with git.

NOTE (2018/06/18): This patch incorrectly resamples in linear space, making the image appear brighter than it should. I've since heard that it would be better to resample in CIELAB space although gamma space would probably be close enough.
 

Attachments

  • area_filter.patch.txt
    11.1 KB · Views: 262
Last edited:
Top