Emulator Issues #8940
openRaster Image Quality Options
0%
Description
Currently we are using a predefinied scaling kernel for upscaling/downscaling when the output frame doesn't match screen resolution (when fullscreen is on).
Coming from the restoration field I know how important is to make the right choice on scaling content, using plain bicubic filters is very different from using others like lanczos. Otherwise a number of problems can arise like aliasing, blurriness or ringing.
My suggestion is to use something along the lines of the state-of-the-art madVR video renderer. You can choose among some "cheap" bicubic kernels like bicubic (0.33,0.33), catmull-rom (0,0.5) or Mitchell-Netravali (0.378, 0.311), or the much better spline and lanczos with 3 or 4 taps each. There's also nnedi scaling but it's a bit out of the scope for this case (purpose and speed wise). What can be additionally implemented though is antiringing (lanczos rings a bit too much) and linear light scaling, the latter can be tricky if you want good looking linear light, for that is recommended to scale in CIE lab space* (read here: http://www.imagemagick.org/Usage/resize/#resize_lab). This scaling kernel should be employed for any kind of resizing (ideally the raster image should only be resized once accounting for both image-to-screen scaling and pixel or display aspect ratio scaling)
*A note on color spaces, I think the raster image should also adhere to a color space depending on output size so correct color management can be used on Dolphin.
Updated by eckso about 9 years ago
Adding some reference and documentation for anti-ringing lanczos:
http://forum.doom9.org/showthread.php?t=145358
https://mechaweaponsvidya.wordpress.com/2014/07/12/a-failed-idea-for-nonringing-resizing/
Updated by eckso about 9 years ago
I also observed there is lack of dithering on (float to integer) output (only rounding?), there are banding issues here and there so there should be an option to choose dither algo and whether it is dynamic or static, although I think static wouldn't be a good option at all.
Sierra or Serpentine Floyd-Steinberg are good algos.
Here are some banding examples:
https://forums.dolphin-emu.org/Thread-dolphin-screenshots-thread?pid=384942#pid384942
I was told the whole rendering pipeline was in low bitdepth (RGB666,RGB565), which is hard to believe but in such case dithering could not be applied.
To sum up, I think it would be nice to have a Raster Quality tab with boxes such as downscale kernel, upscale kernel, linear light and anti-ringing checkboxes, color space rendering intent, dithering algo to use, and whether you want it dynamic, static, color or monochromatic.
Updated by eckso about 9 years ago
Yes, it started as a simple "change internal bicubic to lanczos", and rapidly evolved to Raster Quality Tab... I don't mind if things get going on slowly as long as they do steadily.
Lanczos (and generally common kernel) is well documented:
https://en.wikipedia.org/wiki/Lanczos_algorithm
https://github.com/trevor/ImageMagick/blob/82d683349c7a6adc977f6f638f1b340e01bf0ea9/branches/ImageMagick-6.8.2/magick/resize.c
https://github.com/libretro/common-shaders/tree/6c2ca06be42a3678a4b92f27b8a34ade92bf79bd/windowed
Updated by eckso about 9 years ago
Including links to past request and efforts to raise momentum:
https://forums.dolphin-emu.org/Thread-anti-aliasing-vs-internal-resolution?pid=375050#pid375050
https://forums.dolphin-emu.org/Thread-anti-aliasing-vs-internal-resolution?pid=376839#pid376839