# New Scale Filtering mode: Area-Averaging



## rcdrone (Nov 27, 2017)

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!


----------



## Johan Blome (Nov 27, 2017)

Looks really good. Code?


----------



## rcdrone (Nov 27, 2017)

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.


----------

