# Compressing a mobi file



## David Bussell (Nov 24, 2014)

I have a book that's very image-heavy (to the tune of 26mb!). The delivery cost associated with this means I get very little return on a sale. Is there a way to compress the images and reduce the size of the file, preferably without having to adjust each file individually? Someone suggested I use Calibre to convert from mobi to mobi, which compresses the file significantly, but messes up the book's formatting by randomly inserting blank pages all over the place.


----------



## cheriereich (Feb 12, 2011)

I had this problem when publishing my most recent book. The images took up too many MBs. What KDP's site suggested was lowering the image quality from 100% to 50%-60% in a paint/photoshop program. I did that, and the MBs went down to KBs for the images. The original mobi was around 17 MB and ended up to 1.2 MB on Amazon's end. Plus, reducing the image quality wasn't noticeable in the e-version. The images looked virtually the same whether at 100% or 50% on the Kindle.


----------



## David Bussell (Nov 24, 2014)

Edward M. Grant said:


> I'm pretty sure that .mobi is really just a .zip file containing HTML, CSS and image files, so compressing it won't work: it's already compressed. Presumably the images are .jpg or some similar compressed format? If so, you'd either need to recompress them with a lower quality setting, or shrink them to a lower resolution.


Yes, the images are .jpgs. Certainly I can recompress them, but there are hundreds of images and it would take me forever. I'm looking for a method that will enable me to bulk compress the lot in one go. I'm starting to get the impression I may be out of luck though.


----------



## Gessert Books (Apr 20, 2015)

David Bussell said:


> Yes, the images are .jpgs. Certainly I can recompress them, but there are hundreds of images and it would take me forever. I'm looking for a method that will enable me to bulk compress the lot in one go. I'm starting to get the impression I may be out of luck though.


Photoshop can do this with a batch action.


----------



## David Bussell (Nov 24, 2014)

David S. said:


> The problem isn't the mobi file, it's the underlying images. Take a look at the file sizes. A 100KB jpeg will easily fill an entire Kindle page with no discernible loss of quality. If you have 26MB of images, that's 260 full pages of nothing but images. Do you really have that many images in your book?


Yes, that's the amount of images I have in my book.

While we're on the subject of getting an image to fill an entire Kindle page, does anyone know how to do such a thing? No matter what I try, I always get a thick margin around the whole thing. That's despite reducing my margins to zero on my source file.


----------



## David Bussell (Nov 24, 2014)

cheriereich said:


> I had this problem when publishing my most recent book. The images took up too many MBs. What KDP's site suggested was lowering the image quality from 100% to 50%-60% in a paint/photoshop program. I did that, and the MBs went down to KBs for the images. The original mobi was around 17 MB and ended up to 1.2 MB on Amazon's end. Plus, reducing the image quality wasn't noticeable in the e-version. The images looked virtually the same whether at 100% or 50% on the Kindle.


Thanks. It's nice to know I have that option, even if I'd rather not spend the next week compressing .jpgs!


----------



## David Bussell (Nov 24, 2014)

phillipgessert said:


> Photoshop can do this with a batch action.


Interesting. Is there a way I could have it synch with my Word file somehow so I don't have to reinsert all-new images?


----------



## Gessert Books (Apr 20, 2015)

If your Word file is a DOCX, I believe you can change the extension to ZIP, unzip that file--and somewhere in there, all of your images can be found. If your newly compressed files are named exactly the same way, you may be able to replace them in the ZIP and rename back to DOCX. You'll want to do this with a copy though, because it may well break the file. I honestly don't know if the file would survive that kind of reassembly.

Perhaps there is a more elegant solution that doesn't require ripping the file apart.


----------



## Nick Marsden (Jan 28, 2015)

David, you can either shrink the size of the image, which may require you to adjust their placement in the document, or you can compress the JPGs further (or try using another format like PNG).  This may cause image degradation, though so be careful. A PNG image may be a little smaller at the same size though(?)


----------



## David Bussell (Nov 24, 2014)

Thanks for your assistance, folks. Nothing I tried did the job, so I ended up spending the best part of yesterday individually swapping out all the images for smaller files. I got there in the end, even if the process did make me want to scale a bell tower and take pot shots at strangers.


----------



## Nick Marsden (Jan 28, 2015)

Sometimes the hardest way is the best/only way. This job isn't easy.


----------



## TromboneAl (Mar 20, 2015)

David Bussell said:


> Yes, that's the amount of images I have in my book.
> 
> While we're on the subject of getting an image to fill an entire Kindle page, does anyone know how to do such a thing? No matter what I try, I always get a thick margin around the whole thing. That's despite reducing my margins to zero on my source file.


Here's how to do it:

Compile to an ePub file
Open that file with Sigil (free program, not to hard to learn)
Do two replacements:

width="[0-9][0-9][0-9]"
to
width="100%"

height="[0-9][0-9][0-9]"
to nothing [that is no text in the replace box]

That's what I did in my _Drive, Ride, Repeat_ book. Download the sample, and you'll see how it works.


----------



## David Bussell (Nov 24, 2014)

TromboneAl said:


> Here's how to do it:
> 
> Compile to an ePub file


I'm sorry to say this is the point you lost me.


----------



## TromboneAl (Mar 20, 2015)

My DRR book has forty-three images. I ended up sizing most of them to a width of 500-600 pixels, and saving them with a compression that resulted in file sizes up to 113 KB. You can see the largest ones here:










I keep a folder of the images in full-size and uncompressed format that I used in the paperback.

The final size of my MOBI file was 21 Megabytes.

HTH!

Al


----------



## TromboneAl (Mar 20, 2015)

David Bussell said:


> I'm sorry to say this is the point you lost me.


Sorry about that. I use Scrivener, and the process of creating a mobi or epub file is called "compiling."

So, whatever technique you use for creating a MOBI file, see if you can use it for creating a ePub file instead. At that point, you can open it in Sigil, make the changes I suggested, then convert that to MOBI.

I realize that may still sound like Greek to you.

Images in Kindle ebooks are a bit of a pain. I had to go through a lot of grief to get things to work. There may be an app that makes things easier.


----------



## David Bussell (Nov 24, 2014)

TromboneAl said:


> Sorry about that. I use Scrivener, and the process of creating a mobi or epub file is called "compiling."
> 
> So, whatever technique you use for creating a MOBI file, see if you can use it for creating a ePub file instead. At that point, you can open it in Sigil, make the changes I suggested, then convert that to MOBI.


I appreciate your help, but so far my method for creating a Mobi file has been to upload a Word 2011 file to KDP. I appreciate this probably isn't the most elegant way of going about it, but it's the only way I know. What would you recommend as a way of getting that ePub file?

EDIT: I should add that I have a copy of Scrivener and fully intend on using it for my next book!


----------



## TromboneAl (Mar 20, 2015)

David Bussell said:


> What would you recommend as a way of getting that ePub file?
> 
> EDIT: I should add that I have a copy of Scrivener and fully intend on using it for my next book!


I'm sure there are simple ways to do that, but I'm only familiar with using Scrivener. You could google "convert doc to epub," but you need something you can rely on to get everything right.

You're smart to wait until the next book for using Scrivener. Scrivener doesn't handle images that well--it works, but it's a lot of hassle to get things right.


----------



## David Bussell (Nov 24, 2014)

Thanks, Al, I appreciate you taking the time.


----------

