Taking your painstakingly typeset book and shoving it through the kindle “conversion” meatgrinder was an exercise in wincing. Most of the images were corrupted, there was whitespace sprinkled randomly throughout the copy, and it was a general mess.
Kindle supports direct upload of an html version of your book, but there’s a lot of finessing you need to do before it all goes smoothly. One of the tasks you’ll need to do is convert your book’s images to greyscale, and reduce their size to something Kindle-friendly. There are free tools to help you do this if you aren’t afraid of the terminal.
Imagemagick is a command-line tool (which is perfect for these sorts of batch operations) that provides image operations that are extremely high-quality.
Kindle’s documentation says that the images must not be larger than 450 pixels by 550 pixels, and not exceed 64 Kb. I used (installed via macports with sudo port install imagemagick) on my mac to churn through the images in my Pages document. (If you saved your book as “Documents/book.pages”, if you right-click the document in the finder and choose “Show Package Contents” you’ll see the images.) Here’s an example script to batch-convert your images:
for i in *.* ; do
convert $i \
-channel RGB -fill White -opaque None +channel -alpha Off \
-colorspace Gray \
-resize 450x550\> \
-unsharp 0 -quality 80 \
../$(echo $i|sed -e 's/\..*$//g').jpg
done
What this does is add a white background, flatten the canvas (so no pixels are transparent), switch to greyscale (as Kindle isn’t color), sharpen the image a bit, set the JPEG quality to 80 (high quality), and output the images into the parent directory, encoded in JPEG format. Although line art is better served with PNG or GIF, I found that using the “quality 80″ setting kept JPEG artifacts in rendered text to a minimum.
Related posts:
- Simple PHP image rotation script
This blog has a rotating header — if you visit /header/ and bounce on reload, you’ll see a series of random images. Here’s how it works: The header is added...... - Macports fails to compile p5-perlmagick
If you need PerlMagick on a Mac, there was (and still is) a p5-perlmagick package. If you try to install that package now, you’ll find it doesn’t compile (!!). You...... - Simple Image Slideshow with jQuery and PHP
I really liked Jon Raasch’s jquery-powered slideshow, but integrating it into a page requires a bunch of steps: Add the jQuery library Add the slideshow javascript function Add the CSS...... - Tips with iWork Pages
If you’re writing a book, new chapters need to start on the top of the next right page. To do this in openoffice, you Insert > Break, choose “Page”, then......