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

Laggy when zooming in big images #440

Open
montasellx opened this issue Dec 12, 2023 · 2 comments
Open

Laggy when zooming in big images #440

montasellx opened this issue Dec 12, 2023 · 2 comments

Comments

@montasellx
Copy link

Describe the bug
A clear and concise description of what the bug is.
The problem i have been encountering is the following, when i zoom into rather large images (lice construction plans) the navigation of the image gets laggy even if dezooming.

To Reproduce
Steps to reproduce the behavior:
Add a TransformWrapper with a TransformComponent load a big image 8000KB for example and zoom in as much as you can

Expected behavior
The image is zoomed and the navigation continues to be fluid

Desktop (please complete the following information):

  • OS: windows
  • Browser chrome (have tried on multiple browsers with same results)
  • Version 120.0.6099.71
@mariansimecek
Copy link

Same problem here.

@mariansimecek
Copy link

@montasellx I did some digging and found that the problem isn't with this library but with the browser. When you try debugging it, you find that the bottleneck is GPU rendering.

You can improve performance in various ways:

  1. Add the will-change: transform CSS style to contentStyle. This tells the browser to optimize transforming, but in my case, it makes the image blurry.
  2. Use getMatrixTransformStyles as customTransform. It uses matrix3d instead of translate, and it seems to be more performant. See customTransform prop for more details.
  3. Resize images. I found that images up to 8192px width are okay.

I use this library to show construction plans too. I resolved this problem by combining points 2 and 3.

I hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants