kanryu / quickviewer

A image/comic viewer application for Windows, Mac and Linux, it can show images very fast
https://kanryu.github.io/quickviewer/
GNU General Public License v3.0
536 stars 63 forks source link

Fitting does not work for GIF files #48

Closed zoidbergthepopularone closed 6 years ago

zoidbergthepopularone commented 6 years ago

Hi!

Is it an intent, a bug, or a deficiency in the image library used, that in this config:

Fitting=true DontEnlargeSmallImagesOnFitting=false

GIF images are not enlarged? They get moved to the top left corner, apparently to make space for the enlarging, but they don't get enlarged. Other file formats seem to work OK, but not GIFs, both animated and static. It seems the same is true for MNG files, but I wasn't able to test it properly.

Zoidberg

kanryu commented 6 years ago

What kind of settings do you make for Shader?

When 'interpolation by CPU' is set, QuickViewer determines that the real-time image zooming has performance problems and does not zoom in. Therefore it will be displayed in original size regardless of other settings.

For other settings (e.g. Bilinear interpolation), it will be the intended action as zooming in real time.

Please think that this behavior is specification.

zoidbergthepopularone commented 6 years ago

TBH, I am not sure which setting I should look for. I scanned my .ini file and these are settings which seem relevant. If I should include any other, please let me know which one and I'll add it to the list.

[View] Fitting=true UseDirect2D=true [Shader] Effect=BilinearAndCpuBicubic BicubicShaderPath=shaders/bicubic.frag

I understand what you are saying about this being the intended behavior. But perhaps it might be worth thinking about, adding an option to "resize even if there is a performance penalty".

kanryu commented 6 years ago

'CPU Bicubic after GPU Bilinear' uses 'interpolation by CPU'. Therefore this setting does not zoom in the GIF.

On the current general PC, it needs to take 20-30 milliseconds to zooming the image to 1080p. In this case, it is possible to display moving images of up to 30 FPS.

In the case of the PC with Core i5 / i7, the performance is much worse on the tablet etc. where the Atom CPU was used. Probably not using GPU would be impractical.

It is possible to implement real-time zooming with CPU interpolation, but I feel doubt about the effectiveness.

zoidbergthepopularone commented 6 years ago

Makes sense. Would it be possible to implement better interpolation schemes (compared to bilinear) on the GPU, then?

kanryu commented 6 years ago

Since that question is different from this topic, please post a new Issue if you want to discuss it in detail.

The 'Shader' menu was originally a function for switching interpolation filters implemented by OpenGL's Fragment Shader, but we are currently disabling OpenGL for performance reasons. Therefore, Shader program can not be executed.

Although the drawing of the screen is currently using the standard drawing method of the OS, it can be implemented so as to draw by OpenGL or Direct2D, so that the Shader program can be executed again.

Since OpenGL and Direct2D are not compatible, we need to create Shader programs to use separately.

kanryu commented 6 years ago

@zoidbergthepopularone From the next release, the animation image will be enlarged / reduced regardless of the setting of Shader.

zoidbergthepopularone commented 6 years ago

Thanks, works fine in 1.0.3. Probably the best solution.