jpeg-quantsmooth icon indicating copy to clipboard operation
jpeg-quantsmooth copied to clipboard

Irfanview PlugIn Optimizations

Open TPS opened this issue 4 years ago • 6 comments

@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

  • [ ] exposing the available settings via the UI in a compact way
  • [ ] building against libjpeg-turbo by default for the sake of performance. Loading via the current plugin takes ~2⅛× the time (in my tests), which is why imho Irfan has it disabled by default. IV is known as a high-speed viewer for the last 24½ years, so improving that loading time any amount would make more likely to be enabled (hopefully, eventually by default) & expose your amazing work more widely.

TPS avatar Jan 17 '21 14:01 TPS

(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.

ilyakurdyukov avatar Jan 17 '21 15:01 ilyakurdyukov

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.

TPS avatar Jan 17 '21 18:01 TPS

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 avatar Jan 18 '21 09:01 ilyakurdyukov

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 avatar Jan 18 '21 10:01 ilyakurdyukov

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?

ilyakurdyukov avatar Jan 18 '21 15:01 ilyakurdyukov

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.

TPS avatar Jan 18 '21 21:01 TPS