View Single Post
Old 03-23-2023, 06:16 AM   #1
stutz
Junior Member
stutz began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Mar 2023
Device: kobo clara hd
Avoid loss with jpeg

I have a bunch of comics in cbz format (jpeg encoded), that I would like to optimize for reading on my ereader. Using calibre, I can trim the images to remove the white border and rotate landscape pages so that they fill my screen. However, both options require reencoding the images, which results in ugly artifacts and/or bigger files than the originals.

It should be possible to perfectly preserve the content of the image without increasing filesize by:
1. Only cropping the borders by multiples of 8x8 blocks
2. Using the rotation metadata instead of modifying the pixels

Is it possible to do that from within calibre? Alternatively, is there any tool to do that on linux? I could write a script for the second part using imagemagick's "identify" and exiftool, but I couldn't find how to do the first part.
stutz is offline   Reply With Quote