ilyakurdyukov / jpeg-quantsmooth

JPEG artifacts removal based on quantization coefficients.
GNU Lesser General Public License v2.1
254 stars 21 forks source link

Irfanview PlugIn Optimizations #19

Open TPS opened 3 years ago

TPS commented 3 years ago

@ilyakurdyukov Based on #11 & https://github.com/ilyakurdyukov/jpeg-quantsmooth/issues/18#issuecomment-759963295, I'd like to suggest for the prebuilt released IV plugin

ilyakurdyukov commented 3 years ago

(1) At the moment the plugin works in the highest quality mode (as -q6 in the command line version) and this is set from IrfanView application, but with predefined settings. I suggested making a UI dialogue, but Irfan did not want to implement such functionality yet - until there were enough plugin users.

Here's a discussion of which UI controls are needed: https://irfanview-forum.de/showthread.php?t=12678 It seems that there are still few plugin users so far.

(2)

Loading via the current plugin takes ~2⅛× the time

Than a plugin built with libjpeg-turbo or loading without plugin?

high-speed viewer

Quality and speed don't match well, but I tried to make it work fast.

TPS commented 3 years ago

This is, of course, a bit of chicken-&-egg problem because of tyranny-of-the-default issue: most users won't use because it isn't active by default & so they've no idea it exists. Perhaps a Settings button next to the QS checkbox option in IV would suffice, as is done with other format plugins? Especially if combined with a default of activating only below 𝑥 Mpixels (as requested in the forum thread) & changeable in that Settings option.

Loading via the current plugin takes ~2⅛× the time

Than a plugin built with libjpeg-turbo or loading without plugin?

With the QS checkbox in IV off vs on using your latest build.

high-speed viewer

Quality and speed don't match well, but I tried to make it work fast.

I think you generally succeeded admirably, but these last few tweaks should enable more folks to appreciate it.

ilyakurdyukov commented 3 years ago

With the QS checkbox in IV off vs on using your latest build.

It depends on your hardware because jpegqs uses multithreading (max 16 threads for this build). Also faster for AVX2 compared to SSE2.

It seems like it should run 9% faster with libjpeg-turbo (tested on Linux), but I can't build it correctly with SIMD on Windows using MSYS2 (couldn't link). And if I try to link with the pre-built libjpeg-turbo from the MSYS2 repository - IV crashes when the jpeg image is loaded.

ilyakurdyukov commented 3 years ago

It looks like I did it, but I'm pretty sure you won't be able to notice the difference in speed. Only 2x difference in plugin size. I've added to releases so you can try.

ilyakurdyukov commented 3 years ago

You can write to Irfan by email and convince him that you need a UI, maybe he will agree to add it for the next version.

Have you noticed the improvement in the images yourself?

TPS commented 3 years ago

It looks like I did it, but I'm pretty sure you won't be able to notice the difference in speed. Only 2x difference in plugin size. I've added to releases so you can try.

I'm going through my tests, which will take real-world cases over a few days. Watch this space. Also, ~150 KB increased plugin size is nothing nowadays.

You can write to Irfan by email and convince you that you need a UI, maybe he will agree to add it for the next version.

I will, once I get through below.

Have you noticed the improvement in the images yourself?

The actual rendering difference, yes: with my files, it can be subtly to substantially perceptually better. The speed tests are what I'll be going through for the next little while.