sumatrapdfreader / sumatrapdf

SumatraPDF reader
http://www.sumatrapdfreader.org
GNU General Public License v3.0
13.54k stars 1.72k forks source link

Scroll not smooth under a certain pixel size #2054

Open alkees75 opened 3 years ago

alkees75 commented 3 years ago

Hello,

I've had this problem for quite some time. I mainly read mangas in .cbz/.zip format, with images in .jpg/.png. Except that, when the pages/images are below a certain pixel size: the scroll is not fluid, either with the hand-tool or the scroll wheel. (This is more noticeable with the hand-tool). Example in video (First image: 822x1200 - Second image: 847x1238)

https://user-images.githubusercontent.com/87903330/126870395-539b83ff-0572-425a-89f4-084a7315c23b.mp4

I tested several pixel sizes, and apparently all images below ~1 048 586 pixels in total have this issue.

The problem can be solved by zooming in Sumatra, or upscaling the image like I did in the video, but the quality decreases when you change the original pixel size of a page. So I wanted to know if there was a way to fix this, while keeping the original pixel size of the image.

Here's a zip with the page used in the video, with the original size. Page.zip

GitHubRulesOK commented 3 years ago

Interesting the image "stutters" (in my machine) worse in IrfanView unless viewed at 100% So looking at Information it appears resolution is set to 72 dpi but windows default for rendering PNG is 96 dpi This is a known 4:3 re-calculation issue that affects Images in a PDF where default unit is 72 points/inch If I change dpi to 96 it seems to stutter less but that may just be the fact that its now in memory.

A pixel is a pixel ... so it should not matter if I change it to 96 but just check if it makes any difference on your rig? It probably does not pages.zip

I saved identical scale pages at 96 dpi 001=IrfanView 002=ms paint (much larger due to bitness) For me all 3 seem to be equally smooth within my systems limits of smoothness.

Now back to your "issue" there is a natural stutter when scrolling in windows as the mouse jitters from line to line. If I wish to avoid windows "stepping" the mouse, I need to use the mouse auto-scroll (middle click and just move a small amount). As to why it affects one zoom lever compared to another that may be windows adjusting the dpi scaling so 96dpi at 100% may requires less recalculation compared to other zoom levels.

However I have to agree when zoomed at some ratios the flicker of each line refresh can be very annoying.

On your system you say reducing the scale makes it more noticeable, and the causes can be many fold, since there are multiple step sizes involved and like harmonics in square digital waves the combination of a few stepped waves can create bigger stepping effects than would be seen in an analogue system.

When you upscale the images (which you should at 4:3 for "normal" png 96dpi compatibility) you say there is less of an issue. If you are concerned over image storage size you can keep the colour bits down (which you seem to be doing at 8 bits) 4 bits is often good enough, if done well, for specific images (Comics were often printed in only 4 colors) I never recommend "over compression" as its a slow down for readers (png is default level 6) but you can optimise using a "Riot" filter