How to add images anywhere in .epub files

If you’re like me, then you’d like to add images before each chapter or between blocks of text. Here’s how to do it: Download Sigil, a handy WYSIWYG epub editor.

What I did is create the initial epub with Scrivener, and then open it up in Sigil, make any modifications, add images, and then save. That’s all. If you want to create a .mobi file all you have to do is open up the terminal, drag and drop “kindlegen” inside the terminal window, then drag and drop your epub in the terminal window, then press enter. The .mobi file will be saved to the same folder as your epub.


Out of interest, why aren’t you just adding the images where you want them in Scrivener? This extra step shouldn’t really be necessary unless I’m missing something.

All the best,

Correct me if I’m wrong, but you can’t add images to the draft folder. Furthermore when you compile a draft it’s for text only. The only image you can add via compile is the ebook cover. I’d be thrilled if there was a way to add images to a draft and have them output in an ebook.

What Keith means is, you drag the pictures into your text files themselves, where they should appear in the text, just like a word processor. If you are compiling to ePub, then it isn’t text only (there are some formats that are, but neither of the e-book options are). Note that you can double-click on the image to resize it. This altered size is what will be used in the e-book. It’s probably best to resize them in Photoshop or something if you can, though, as the quality of the scaling will be better. It’s pretty good though.

Exactly - you can insert images into your draft just as you can in any other word processor. You can’t store image documents in the Draft folder as separate entities, but you can certainly have images in the text, which will do exactly what you want.

All the best,

One of the books I just finished had several images in it, and also a List of Illustrations in the front with links to the images. When I tried to make these into Scrivener links, I could only select the name of the chapter, that is, its first page.

Also, images in Scrivener leave white space on either side. There’s no way to make text flow around them, as in a page-layout program.

Other than those two limitations, placement of the images worked out fine.

Well, I’ll be damned! This is great news. I never recalled seeing it in the manual. Thank you so much for the tip and you’re excellent app. Without it I’d be drowning in a sea of Pages.

This should be possible in 2.1 provided you put the image in its own document (in 2.0.5 this was indeed a limitation).

Not if you set them up right. There’s an annoying glitch in the OS X text system where line spacing gets applied to images. So if you have 1.5 line spacing, an image on its own will have a gap above it half the height of the image. You just need to make sure that images only have 1.0 line spacing. If you override the formatting during Compile, apply “Preserve formatting” to images for now, to ensure they don’t get the extra line spacing applied when the formatting is overridden. In 2.1 this won’t be necessary, as Compile checks for lines that contain only images and doesn’t override their line spacing. I also have a technical support issue out with Apple to see if there is a way of avoiding the issue entirely without having to be mindful of line spacing.

All the best,

That tip about the way the Mac OS handles graphics in Scrivener worked great!! I was in the middle of adding multiple graphic images to my text and had this annoying space at the top of each photograph. Setting the spacing to 1.0 did the trick for most of my graphics.

Interestingly, a few of the graphic images still had some annoying additional space, even with spacing set at 1.0. So I went to the spacing tab and selected “0.9”. The graphic immediately moved up, but now overrode the text above the graphic. Setting spacing immediately to “1.0”, which is the setting I wanted in the first place, did the job.

Now it looks great, and I can complete the job!

Thanks again!!!

Glad it helped! I actually have a technical support incident out with Apple Developer Technical Support at the moment about line spacing and images, in the (probably vain) hope that the default behaviour can be improved.

All the best,