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

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

Open
Pocokk opened this issue Feb 3, 2024 · 3 comments
Open

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

Pocokk opened this issue Feb 3, 2024 · 3 comments

Comments

@Pocokk
Copy link

Pocokk commented Feb 3, 2024

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.

@ghost
Copy link

ghost commented Feb 3, 2024

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:

  • Optimize the png with a tool like oxipng (lossless compression)
  • Use the --jpeg argument for unkindle to output as jpeg instead of png (lossy compression)
  • Recompress the png pages to whatever format/quality you'd like using a tool like imagemagick

@salami-ch
Copy link

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
Copy link
Owner

@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.

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

3 participants