athrowaway2021 / comix

Seamlessly download and de-drm comics and manga from Kindle in highest possible quality
MIT License
61 stars 20 forks source link

Did they retroactively increase the image quality on all titles? #53

Open Pocokk opened 8 months ago

Pocokk commented 8 months ago

Hello, I know this isn't a comix related bug or issue per-se, but can't find a better way/place to discuss it, apologize for it in advance!

I had a book that was released back in August 2021, way before the switch to the new framework and such.

It was 28MB, but when I download it again now, its 63MB.

I know Amazon did increase the newer title's image quality to 97 at the end of June 2023, but it seems they also messed with their previous files as well.

Question: is there any way to get the result of those earlier settings (lower file size, less quality etc) without manually going through the downloaded images via Magick or any other converter?

Thank you.

neckothy commented 8 months ago

This is mostly covered in the updated README. Unless the files were updated by the publisher, the pages will be (almost) the same. The difference is that the HD content is now split in to many tiles that need to be recombined to create the pages. The original, untouched jpeg is no longer accessible. To avoid introducing compression artifacts these tiles are combined as a png which can increase the image size, especially for color images.

If you're concerned about filesize, here are a few suggestions:

salami-ch commented 8 months ago

JPEGtran supports losslessly combining tiled JPEGs when a couple of factors are fulfilled: https://stackoverflow.com/a/29615714/2364680

Has anyone experimented with the files pulled from AMZN and checked if the preconditions would allow this? Watch out for the comment in the linked answer (don't use the MozJPEG version).

athrowaway2021 commented 8 months ago

@salami-ch Yes it's possible but the page image's dimensions must be a multiple of 8, which rarely is the case, so it will have to have padding on the edges of the final image. Some tiles also have padding that prevents placing them on coordinates that are multiples of eight, resulting in either overlap or gaps. I've attempted to use jpegtran to solve this but have not seen a single book that meets these conditions and you can't deal with the excess padding losslessly so that brings us back to square one of having to reencode the image.