sumatrapdfreader / sumatrapdf

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

Disable Resampling when zoom-in #668

Open kenkangxgwe opened 7 years ago

kenkangxgwe commented 7 years ago

Thanks for this great software! I've associated nearly every document formats and picture formats to it. Recently, when I viewed a picture in sumatrapdf, I found that zoom-in makes the picture blurred. It seemed that resampling (or maybe interpolation?) -- I am not familiar with the algorithm -- were applied. For example, if original picture is test1 zoom in sumatra will give me this, image Although, irfanview gave the same result as above in default setting, it correctly displayed after I disabled the resample feature, and it showed, image

So, if there is any possibility to add a option to enable or disable the resample in the advanced options? I really like this software, hope it become more powerful!

Ken.K

GitHubRulesOK commented 4 years ago

image

Here you can see exactly the same image in both modes (alias and antialias) There is no way for the user to swap between them one is a common function for image readers to soften the unatural edges of comic book and digital photos the other is the desire to maintain a sharp edge to artwork in a digital document.

@kjk is there a posibility to have a setting to NOT alias image files (however that may upset SOME comic book readers)

Synetech commented 1 year ago

Upsetting comic-readers who want to use SumatraPDF to read comics instead of a dedicated comic-viewer like CDisplay is a small price to pay to make PDF viewer actually work correctly. The anti-aliasing breaks things like QR-CODES that are embedded in the PDF because it smooths them out, making them unreadable by some code-readers. 🤦 - I just did a test and apparently, it doesn't stop anti-aliasing until at least 274% zoom (at least with the QR-code in the PDF I tested). There needs to be an option to just turn it off.

GitHubRulesOK commented 1 year ago

@Synetech I think you misunderstood my point the sharp one on the right is the same one saved by SumatraPDF as a PDF it is pixel perfect no screen optimisations beyond normal the problem is usually the writer has not aligned the pixels as monochrome or as greyscale (which is only needed for skewed QRCodes.) here is a QR code as you say enlarged to actual size (100%) to fit the design area there cannot be antialiasing otherwise there would be no pixels. image

here zoomed out roughly 33% its the screen that has the problems keeping the white same size as the black. But still works on my phone. image

Synetech commented 1 year ago

Maybe, it's got to do with the complexity. The demo you showed is simply and has large pixels. I took a screenshot of the QR code from the PDF of my vaccine record so that I can keep just that on my phone instead of all the human-readable text and when I zoom into the screenshot, it's got grey pixels all over it. The QR code is a 388x388 code with a lot of tiny pixels. If I zoom into it in SumatraPDF, it's fine, but if set the view to anything less than 274%, screenshots of it are anti-aliased (setting it to 274% and taking a screenshot is black-and-white). I'll find some more QR-codes to test, but it's definitely being resampled.

GitHubRulesOK commented 1 year ago

you used a camera that is lossy QRcodes are intended to be like fonts simple vector graphics each dot is one dot or more if you want it bigger so often one dot is increased 4 or 5 times but a dot is a dot is a non width object what cameras do is they average all the surrounding values of each dot and add halos basic JPEG is an average of 64 dots at a time so it will vary on zoom PNG should not vary except the screen has to colour them RGB so there is subpixels inherent in using screens and bleed when using ink.

If I use a more complex QRCode as you say 388 then n a PDF it should be 388 pixels no less no more but if it was converted to JPEG the pixels would be distorted by JPEG averaging.

GitHubRulesOK commented 1 year ago

Image zoom at 50% (half size) click to see it as normal 50% not web reduced. image

PDF at 100% perfectly workable thats a chunk of a pdf image