Forum moved here!

# Home / Grey dots in cbz comic containing jpeg files

Hanlea

Good evening,
I have a comic as a .cbz file that I want to read with SumatraPDF v3.2.
The images inside the .cbz are saved in the .PNG format.

In order to save some space I saved the images as .JPG files with IrfanView and repacked them into a .cbz file. The original images are perfectly fine, but when I open the .cbz with Sumatra there are grey dots all over the image. The top shows what I see with PNG files, the bottom is with JPG files:

When I save the original .PNG file to .JPG with Microsoft Paint, instead of IrfanView, it looks similar to the .PNG, beside the way heavier JPG compression.

What is causing SumatraPDF to display these dots?
Am I using the wrong methods to convert the .PNG to .JPG or is it something on the PDF readers side? (I read that this can happen if the reader doesn’t support the latest JPG compression methods or something like that?)

Or am I using the wrong tool for the job and should look for other readers?

Thank you for suggestions and have a nice day.

GitHubRulesOK

PNG is normally “lossless” thus good for solid or dithered colors as found in comic books
JPG is “lossy” thus good for photos where the color is constantly varying and patchy approximations are much less noticable.

Compression with PNG (using the right tools can be better than a mild jpeg compression) using Irfanview you can often drop color range to 256 colors and using quality dithering, not spot any degrading, but if the dithering is causing noticable “spots” then avoid it.

The aim is never to make the file the smallest and thus slowest to unpack/read. It should only need reducing for email or webside transmission, a user should not need to pack files for “themselves” the basic zip format should be adequate for most users. Stripping a few bytes here and there is a “loose, loose” situation as you waste time compressing then waste time decompressing.
I was an advocate of packing everything in the past when storage and transmittal charges were \$10’s per MB but now realise it more simply cost years off my life. Keep it simple let the format dictate the average compression.
msPaint Png clipped at 8 KB and Jpg at 4-5KB look similar

Irfanview can save PNG also at 4-5 MB (median filter to minimise the paler infill, if thats what you need, and color reduced) or without median filter

That last enhanced one is png but at around 2KB its less than 1/3rd the original storage, but as always it depends on the purpose as to what enhancements may be useful, size reduction is a by product of cleaning out artifacts.

kjk

JPEG is lossy so compression artifacts can happen.

If you share one of those .jpeg files, I can determine if it’s just badly compressed file or something related to Sumatra (which is unlikely because JPEG is a very old format and we use one of the most popular jpeg decoding libraries).

Or you can check how other programs view this image.

Without a sample image most likely you over-compressed .jpeg which caused the compression artifacts.

Hanlea

Hello,
is there a way to send you some files via private message, @kjk ?

And I investigated the problem a little further:

Observation 1: When I open the files with other software, for example Honeyview or MComix, the dots are not visible. I don’t know what these softwares do differently. I read that the cause could be an older version of JPEG decoder, but I don’t know if that is true and have no way to confirm that.

Observation 2: It only happens when I grayscale the image.
If I convert a PNG to a 24BPP JPEG it looks okay. If I convert it to a grayscale 8BPP JPEG I get the visible dots.

In addition to that, there are differences depending on the quality level and what I convert the image with.

An image saved with Photoshop on level 8 has less dots than one saved with level 10. If saved with something like IrfanView, the quality level makes nearly no difference and both a 80% and a 95% image will look worse than the level 10 PhotoShop one.

GitHubRulesOK

Image pixels that start out as scans (or photos) will each vary in colour even if it is a single slab of one flat colour it is a native part of the scanning (camera) process
Computer generated vector art is different as each pixel can be coded the same as its neighbour.
Png tries not to vary the RGB components from the raw source pixels, but Jpeg will modify them to improve the compressive coding.

It is thus natural that if you reduce the colours in PNG (to greyscale) each neighbouring pixel will tend to look MORE similar in tone.
However if you make JPG more aggressive then each image spot may become MORE pronounced in its colour tone difference.
JPG is only good for approximating photo storage, it is not good for colour manipulation.
Scanning or photos should initially be stored in a native lossless filetype such as 48bit RAW Tiff using Zip or LZW type compression. Professional camers and scanners only offer Jpg for users convenience, not quality.
Any secondary outputs such as a computer screens 24 bit or lower bpp formats should also be lossless (without artifacts) hence the suggestion to only convert to PNG or similar.
JPG format has its uses but computer graphic manipulation is not one of them.

you can contact Chris via email to kkowalczyk @ gmail.com