Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad performance when panning large images #272

Closed
Keith94 opened this issue Nov 15, 2017 · 17 comments
Closed

Bad performance when panning large images #272

Keith94 opened this issue Nov 15, 2017 · 17 comments

Comments

@Keith94
Copy link

Keith94 commented Nov 15, 2017

Steps to reproduce

  1. Open a very large image (15+ MB), eg https://eoimages.gsfc.nasa.gov/images/imagerecords/78000/78314/VIIRS_3Feb2012_lrg.jpg
  2. Press Ctrl++ to zoom in
  3. Click and drag on the image to pan/drag

Expected results

Smooth and responsive performance while panning

Actual results

Extremely bad performance/frame rate while panning

System info:

  • ImageGlass version: 4.5.11.14
  • OS version: Windows 10
@d2phap
Copy link
Owner

d2phap commented Dec 1, 2017

The issue is that the image dimension is too big to ImageGlass 12000x12000.
I think this is the threshold

@SonamorN
Copy link

I just logged in to say that I've downloaded the image and used the latest stable version of ImageGlass to view it.

Zooming was instantaneous while panning was a little bit slow but I wouldn't class it as extremely bad performance.

I am using a laptop with Win 10 Pro 64 bit, i5-5200U and 8GBs of RAM. So is there any chance that zooming/panning is not only software related but hardware related as well?

@Keith94 do you have a better computer where you could test the same image?

@Keith94
Copy link
Author

Keith94 commented Dec 14, 2017

@rNianios I don't, but if you test the image against another software e.g. Windows 10 Photos app / Firefox Nightly, the difference is very noticeable, and performance is buttery smooth.

@BinaryLoopCode
Copy link

The problem here is that ImageGlass does not use your video card to hardware-accelerate the rendering process. This problem is exasperated if you enable "Smooth pixels" as a zoom optimisation under Settings > Image > Zooming, zoom in and out and then pan around a zoomed in image of ANY size (doesn't have to be a massive file size. It is sluggish and unresponsive.

The reason is easy to see. Open Task Manager while panning or zooming in ImageGlass and you'll notice the CPU spike up to 20-30% with a 0% load on the GPU. Do the same in Windows 10 Photo viewer and it elegantly handles the workload by efficiently assigning up to a 15% load onto my GTX 1080 while reducing the workload on the CPU. Since the video card is very good at this type of work, Photos is able to handle very smooth zooming and panning even while smoothing the pixels when zoomed in.

I am trying to replace the Windows 10 "Photo" app with something better as it is pretty frustrating in many ways. ImageGlass was looking like it might be on the way to achieving that goal but unfortunately, not having GPU rendering is an absolute deal breaker for me. As a picture viewer, if you can't pan or zoom smoothly on a picture.. well that's the main function a picture viewer should be able to handle well and sadly, this isn't up to scratch!

@d2phap I had a look but didn't notice any options to enable GPU rendering. Is this a possibility with the existing software or something you could look into adding? As mentioned, it really is a deal breaker and prevents me from considering this software. I suspect it's a deal breaker for others too but they just see it as "too laggy."

@d2phap
Copy link
Owner

d2phap commented Jan 13, 2019

Hi @BinaryLoopCode
IG is build on winforms technology which is not hardware-accelerated.
So this is a limitation, i am still looking for a better solution.

@Dogway
Copy link

Dogway commented Feb 3, 2019

+1 for this. UI wise the program is pretty much covered, so after the color management was implemented this is the last bit remain. Just posting so I can keep track of the issue.

@Hazbelll
Copy link

Hazbelll commented Jan 22, 2020

Any updates on whether hardware acceleration will be implemented? This would make an already brilliant image viewer even better, especially for mobile (Laptop, tablet, etc.) users as it helps conserve battery since the GPU is better suited for such tasks. Likewise, it gives an edge over what appears to be almost every other third party image viewer which also seem to lack hardware acceleration of any kind.

I see @d2phap's request for Hardware Acceleration to be added to WinForms was rejected, but how about WPF? I believe WPF does feature hardware acceleration, although my own experience with using WPF is quite limited so I am unable to provide further information (or a real idea of how much of a pain it would be to switch over and/or any constraints WPF brings).

@d2phap
Copy link
Owner

d2phap commented May 2, 2020

To update here,
I am working on an UWP version. It will take some time.
There will be preview versions.

@unquietwiki
Copy link
Contributor

@d2phap https://devblogs.microsoft.com/dotnet/windows-forms-designer-for-net-core-released/ this might be a partial solution for this situation. Since the newer builds are using at least .NET Framework 4.8 now; when VS 2019 16.7 is ready, we could try re-targeting against .NET Core 3 or 5 (whatever's out at that point), and see how it all works.

@rohitghali
Copy link

Any update about gpu rendering yet? Everythign is perfect except hardware acceleration.

@d2phap d2phap added this to the v9.0 milestone Jan 5, 2022
@d2phap
Copy link
Owner

d2phap commented Mar 19, 2022

To update, hardware acceleration is partially supported in v9 (only for non-alpha formats), and the performance for panning, zooming is also significantly improved when it's on.

IG v9 is still under active development. The first beta is targeting by end of March. You can check the progress at https://github.com/d2phap/ImageGlass/projects/11

@unquietwiki
Copy link
Contributor

@d2phap This would be a good time to tie in #1314 ; I think that goes in the opposite direction of GDI+, unless there's a way to tie the two together? I did find that DirectX 12 works on Windows 7 (which has been deprecated for a bit now), and that texture limit might not exist under DX12? The docs don't seem that clear; you might be able to make more sense of it.

@d2phap
Copy link
Owner

d2phap commented Mar 19, 2022

DirectX12 is the latest version of DirectX, but it only supports up to 16384px. IG v9 just uses a small features of Direct2D (it's quite complicated to me).

I have another plan for v10 that is to only support for Windows 10 (64-bit) or later, use WinUI 3 (or MAUI). I could do it for v9 already, but IG still has lots of Windows 7 users. So supporting GPU in v9 will make those who can't upgrade to Windows 10 or later happy. WinUI 3 is still very buggy and its APIs are still unfriendly. Hopefully by the time, it will get much better.

@unquietwiki
Copy link
Contributor

@d2phap I've been hearing good things about MAUI. This will more or less put my old "Billgatus of BORG" poster to rest for good. 😆

@d2phap d2phap removed this from the v9.0 beta 1 milestone May 21, 2022
@d2phap d2phap added this to the v9.0 beta 2 milestone May 21, 2022
@neoOpus
Copy link

neoOpus commented Jun 5, 2022

DirectX12 is the latest version of DirectX, but it only supports up to 16384px. IG v9 just uses a small features of Direct2D (it's quite complicated to me).

I have another plan for v10 that is to only support for Windows 10 (64-bit) or later, use WinUI 3 (or MAUI). I could do it for v9 already, but IG still has lots of Windows 7 users. So supporting GPU in v9 will make those who can't upgrade to Windows 10 or later happy. WinUI 3 is still very buggy and its APIs are still unfriendly. Hopefully by the time, it will get much better.

please focus on making it better and faster for those who upgraded to Windows 11, there is plenty of image viewer already and they will not be left behind unless they are willing for... WinUI 3 is getting better lately and GPU acceleration is a must, even some light AI based functions would be very welcome... IrfanView is more than enough for Windows 7 users 99% of the time

@d2phap
Copy link
Owner

d2phap commented Sep 6, 2022

  • v9.0 beta 2 added support GPU rendering for transparent image formats. The maximum image dimension is till 16384 x 16384 pixels.
  • Animated GIF/WEBP format is still use GDI+ for less resource.
  • Supports smooth & precise zooming by keyboard / trackpad.
  • Supports smooth panning by keyboard when enabling Image Focus mode.
  • Switching Direct2D/GDI+ <-> GDI is too complicated. In v9.0 beta 3, I will resize the image to 16384 if it is larger than that number.

@d2phap
Copy link
Owner

d2phap commented Dec 24, 2022

ImageGlass Moon 9.0 beta 3 is released with support open the image that is larger than 16384 by scaling it down to 16384px. So this is it for now.

@d2phap d2phap closed this as completed Dec 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants