Quote:
Originally Posted by jhowell
My interest is seeing that the cover image makes it into the KFX file without a loss of quality. What happens after that in rendering the image on a Kindle device is not under my control so I do not see any point in posting Kindle screen images.
What I meant by asking for an example is any case where the original cover image does not make it into the KFX file unchanged. The easiest way to check for that is by converting from KFX back to EPUB using the command line interface (CLI) of the KFX input plugin. Using that avoids potential image manipulation by calibre itself. If a case can be found I would need to be able to duplicate it myself using your source file to determine the cause.
I previously mentioned one known issue. If the original cover image is not in JPEG File Interchange Format (JFIF) then it will be regenerated by the plugin with a possible loss of quality. I will look into improving that.
In addition calibre's conversion and metadata updating system can impact cover images. I recommend using the KFX Output plugin CLI to avoid those possibilities.
There may still be other cases that I am not aware of. The bulk of the KFX conversion process is performed using Amazon's Kindle Previewer and that might potentially do further image manipulation that only comes into play under certain circumstances.
|
Ah, I see. I haven't even considered that. I did most of my own conversions to kfx using command line, but I converted them back to epub using gui in Calibre (laziness). I'll go and do it both ways using CLI asap.
Test 1:
Ebook that includes plenty of low resolution illustrations:
Three Men in a Boat: EPUB3 version: "pg308-images-3.epub"
https://www.gutenberg.org/ebooks/308
I converted this epub into kfx, then back into epub using CLI:
I opened both epub files, and extracted images. Cover images appear to be identical. Same file sizes. Under extreme pixel peeping, I could not spot a single difference. Illustration images are changed slightly. File sizes in "pg308-images-3 back to kfx.epub" can be slightly smaller or larger compared to files in "pg308-images-3.epub". Image quality isn't worse, but it's possible to spot differences in this case.
Test 2:
Small resolution cover: From above "PNG Vile Bodies.png". Opened in FastStone, then saved as "PNG to JPEG Vile Bodies.jpg" jpeg at "Quality 100, GrayScale"
I replaced cover present in "pg308-images-3.epub" with "PNG to JPEG Vile Bodies.jpg". I just manually opened .epub in file explorer, and replaced it. Exactly the same conversion as before. Results are not identical. New file is slightly smaller, Faststone reports that it has 21 colours compared to 13 of the original file, but differences are practically impossible to spot.
Test 3:
High resolution cover. Sample used in attachment to this post. "2col.png". I only used 2 channels while dithering this png, so file size remains low enough for this forum to leave it as png. It was converted to jpeg in Faststone at max quality. File size increases to about 20mb, colours from two to five. That jpeg was then used as a cover in the same .epub file. Same procedure as "Test 2". Results this time are identical. File size of original jpeg and the one that went through conversion is identical. I can't spot any differences, even while pixel peeping. Illustrations are changed.
Test 4:
Same as before, but I used Calibre to convert file back from kfx to epub. Tablet output, epub3, use cover from source file. Identical results as in Test 3.
Notes:
- I believe that incorrect Calibre setting in the test carried in the previous post caused big differences between results, and got me to believe that something off was going on.
- I'm still not exactly sure what causes files to be untouched in certain cases, while adjusted in others. It may be that it's something to do with the way original .jpeg files are saved. "PNG Vile Bodies.png" was saved as jpeg in colour profile, while I was careful and saved 2col.png in black and white profile. Also, as I converted it from .png to .jpg, I used grayscale option and made sure to turn every possible compression setting off. Coincidently, doing this in Photoshop, gives less options regarding this.
- I'll test this a bit more to figure exactly what's going on. As far as quality is concerned, doing everything by the book, appears to leave everything untouched, or at least in so high quality that differences are very hard to spot, but I'm still wondering what exactly happens. Especially, why are covers images untouched and illustrations changed.
More notes:
- So I did a few more tests, and there is quite a bit of difference in files saved in photoshop and ones saved in Faststone. So there really must be something with the way .jpeg files are saved. I used same 2col.png as source. I opened it in Photoshop, changed it from grayscale to rgb, then saved it as jpeg at max possible quality. File size was 15mb. I packed that file into .epub. I again did .epub to .kfx and back to .epub using CLI. And resulting jpeg file was 5mb smaller, and went from 8 colours to 22 colours. I also did the same but kept the file in grayscale. Resulting file was of slightly different size. In both cases it was practically impossible to spot differences compared to original .jpeg that was generated in Photoshop, but it wasn't identical. Going by the Faststone procedure, files were identical. Puzzling.