emulsion icon indicating copy to clipboard operation
emulsion copied to clipboard

Sharpness of images at varying zoom

Open thomasaarholt opened this issue 4 years ago • 6 comments

Thanks for making this! Really nice.

In comparison with the standard Windows 10, Emulsion looks a bit blurred on the following screenshot. See the scale bar at the bottom left in particular. I'm sure there are several strategies for smoothing and anti-aliasing, what does Emulsion use? Original png attached.

image

thomasaarholt avatar Apr 21 '20 21:04 thomasaarholt

Indeed. This is something that I don't have experience with, although this is definitely within the scope of my interests so all I'm saying is that there may be someone else who could tackle this more efficiently than I could.

ArturKovacs avatar Apr 26 '20 21:04 ArturKovacs

The question in the post somehow eluded my attention. Emulsion currently generates up to four mip-maps and then it uses "LinearMipmapLinear" filtering for minification and "Linear" filtering for magnification by default. "Nearest" is used for maginfication if the renderend texel size is greater than some threshold.

ArturKovacs avatar May 04 '20 21:05 ArturKovacs

I noticed this bug as well:

Screenshot_20200506_194037

Images are, when scaled down, slightly more blurry than they should be. This is most obvious when the image contains text:

Help screen blurry

The right picture is emulsion showing the help dialog. The left picture is the same image, opened in emulsion normally.

I wonder if the method used to render the help dialog could be used for other downscaled images as well.

Aloso avatar May 06 '20 18:05 Aloso

The info screen uses regular linear filtering for minification. Nevertheless I can get the two to be exactly as sharp, but it's super sensitive to the scale. Just one pixel off and the one displayed as an image is significantly blurrier.

I made some quick tests to see if this can be improved by simply switching the filtering mode. And indeed it improved by a lot when using NearestMipmapLinear. The photos app still seems to do better but we are pretty close now.

From left-to-right: Old Emulsion, Win Photos, New Emulsion

image

ArturKovacs avatar May 06 '20 18:05 ArturKovacs

It's much better now. Only below a certain zoom threshold, it looks as before.

Aloso avatar May 06 '20 22:05 Aloso

Krita spent a lot of time on a good interpolation method for their OpenGL canvas mode. Perhaps the approach or even the code can be copied if the license allows.

Shnatsel avatar Jun 01 '20 14:06 Shnatsel