d2phap / ImageGlass

🏞 A lightweight, versatile image viewer
https://imageglass.org
Other
7.75k stars 499 forks source link

Smoother zoom and better performance with antialiasing #522

Closed Sumsar3 closed 1 year ago

Sumsar3 commented 5 years ago

Hi. Yesterday I discovered this program looking for alternatives to windows app, and I like Imageglass very much, but there are two big problems that I find it hard to use this program.

1: The zoom isn't smooth. From 100% to 150% 200, 300, 400... they are big steps. I can't focus some details of the photos with accuracy with this zoom. Other programs (like picasa viewer) have 100,115,132,152,175,201... a much precise zoom with very nice animation.

2: The antialiasing option kills the performance of the program, specially on 4k/2k resolution. I tested too much image viewers, and almost every one have antialiasing when you zoom above the 100% and in no one kills the performance. This is weird.

This 2 problems are the only problems I find. The program is very nice and I like very much, but I can't use this until this problems are fixed.

Thank you very much and excuse me for my english.

d2phap commented 5 years ago

Thanks @Sumsar3

2: The antialiasing option kills the performance of the program, specially on 4k/2k resolution. I tested too much image viewers, and almost everyone have antialiasing when you zoom above the 100% and in no one kills the performance. This is weird.

You can try other options in Zoom Optimization.

image

fire-eggs commented 5 years ago

Additional, finer levels of zooming are now possible:

image

brunogm0 commented 4 years ago

Hi, I already saw previous closed issues but to contribute for the future: First allow sigmoidization for upsampling will correct many issues; In the same way downsample in LAB color space; For speed-up with a nice edge I like MPV player oversample filter, that is a little better than nearest-neighbor maybe tweak the param of interpolation from default always to some interval 0.1~0.33; Then add robidouxSharp, Anime4k as a option ; EDIT: acme-0.5x.hook is fast downsampler for +4k;

In my RX460 gpu using mpv the cost is: oversample 700ns nearest 1400 Mitchell 1600ns anime4k 3500ns robidouxsharp 4000ns catmull_rom 4000ns ewa_robidouxsharp 4700ns Lanczos 5150ns jinc 6300ns

examples: https://github.com/haasn/mpvhq-upscalers https://imagick-filters-comparison.netlify.com/ https://github.com/bloc97/Anime4K

mirh commented 3 years ago

Jeez, it's crazy what they could pull out with just a couple of shaders. Though to be fair that's still quite above the level of complexity we have now, just hooking into .NET's own algorithms

https://github.com/d2phap/ImageGlass/blob/e2cfa0d9a2ba8d4441a63c2c0c0941b510474fe1/Source/ImageGlass/frmMain.cs#L1659-L1673

The outrageous thing is that nearest neighbourhood is the default for zooming. Even though at least with normal photos, it's neck to neck with whatever "low quality" is... It cannot be overstated just how bad it is for artwork and text. EDIT: I can also report how even just moving around a scaled high resolution image is super slow

d2phap commented 1 year ago

@Sumsar3 You can try IG v9.0 beta 3 which supports smooth zooming and panning with hardware acceleration.

For accurate zooming, you can use "Custom zoom", and enter the zoom value. Please note that, zoom steps are removed in v9.0 beta.