I recently published the Kindle edition of my book on mobile technology.
Normally this activity should have been a breeze given the excellent online tools provided by Amazon Kindle Direct Publishing (KDP as it’s lovingly called by ebook authors).
If your manuscript is a Microsoft Word document, all you need to do is upload it on KDP and KDP’s online converter will convert it into the Amazon eBook format (.mobi). It will also let you preview it using their online previewer, and you are good to go.
Alas, not so for me.
You see, my book contains more than one hundred illustrations. Many of them are hand drawn by me, and most of these have text inside the images. All my illustrations are created as jpeg files using 100% quality (i.e. 0% compression) and at 300 dpi.
When I uploaded the Word manuscript containing all these images to KDP, and previewed the result in KDP’s online previewer, I quickly discovered that the automatic online conversion that KDP had done on the document, had resulted in all images being automatically down-sampled to some ridiculously low resolution.
I had expected my ebook to be resplendent with beautiful, sharp images such as the following:
To my disappointment, the images displayed by KDP’s previewer looked something like the following:
This was a huge problem. My book is called “An Illustrated Guide to Mobile Technology”. I couldn’t see how I could possibly publish it if the illustrations looked like something you would see through smudged glasses.
I spoke with Amazon’s customer support and was pointed to KDP Help pages on how to publish an ebook containing images. Specifically they told me to do this:
- Format images in a 600 x 800 pixels and 300 dpi resolution
- Insert images, don’t copy and paste
- Align images to the center of the document
- Remove all empty line/page breaks between each image
- If images are schemas, charts, tables, maps, or any format that includes text, save the image in GIF format to ensure the text is legible after conversion
My images were already 300dpi, inserted (i.e. not copy/pasted into the doc), center aligned and without any spurious breaks between images.
I scoured through the internet and through KDP’s support forums looking for someone who had experienced a similar problem and had found a solution to it. I tried converting images with text into GIFs as advised by Amazon but the images still came out butchered in the Kindle version.
I experimented with different JPEG compression ratios, I tried using PNGs instead of JPEGs, I tried adjusted the aspect ratio of images to match that of the Kindle Fire HD device. Still nothing. The images still came out heavily pixellated in the Kindle ebook version.
The writing was on the wall. I couldn’t simply upload a Word doc to KDP and trust KDP’s online converter to do the right thing with all the images in the document. I would need to take the bull by the horns. I would have to create a .mobi file and upload it to KDP.
And hey presto, it worked!
Well, here’s what I did:
- In Calibre, I right clicked on the generated epub file and selected Open Containing folder.
- I renamed the .epub to a .zip. The epub is really a zip file. I then unpacked the zip file.
- I navigated to the unpacked folder and went into the images sub-folder. This is where all the images in my word document were stored. I found that Calibre had somehow reduced the pixel dimensions of every single jpeg image, while maintaining the DPI as 300. Therefore I had to manually replace every single jpeg image in the images folder with the original jpeg image.
- Finally, I zipped the epub folder and renamed the zipped file as .epub
I downloaded KindleGen from Amazon. KindleGen is the official command line tool from Amazon for converting a variety of text media to the Amazon eBook format .mobi. KindleGen accepts .epub files as input.
I ran KindleGen on the .epub file, like so:
kindlegen.exe filename.epub -c0 -verbose
Doing so generated a .mobi file.
I had to fix a few minor errors and warnings that KindleGen generated, mostly to do with bad image links and TOC references in the epub. These were easy to fix by using the Visual Edit feature provided by Calibre. (Just right click on the epub title in Calibre and select Edit Book).
Finally, I uploaded the .mobi file to KDP.
This time KDP’s online converter preserved the image quality perfectly!
And here is the fruit of my labor.