Scrivener is making very large .epub files?

PDFs are usually much bigger then ePubs, right? Because .epubs are little more than glorified HTML files.
So… Why is my Scrivener making ePubs that are more than three times the size of the PDF from the exact same story with the exact same settings?

I have a story which is around 80,000 words with one PNG image as a cover.
The resulting PDF is around 2Mb, and the ePub is around 7Mb. I cannot for the life of me figure out why the ePub is so big.

It’s possible that the PNG (dimensions?) actually ends up as a heavily compressed JPG in the PDF. Depending on its size, this one file can make a difference, as weird as it sounds.

1 Like

It’s a 1536x2400 PNG, 4.84Mb in size. It ends up compressed in the PDF, but that wouldn’t explain why the ePub is the size of the image AND the PDF.

Do you need to use PNG? PNGs are up to 10 times the size of a JPG.

:slight_smile:
Mark

It could. Your ePub: The unchanged PNG + the text (of course) + all the HTML code. Uncompressed. Your PDF: A much smaller cover image, plus all the other stuff, compressed.

Test-compile an ePub with a smaller JPG-cover, zip the resulting file and compare the files sizes.

That worked … Sort of. I mean it made the ePub much smaller, but not as much as I thought.
The PDF (with the better PNG image) is 2036kb. The ePub (with the compressed JPG) is 1814kb.

The PNG is 4958kb, the JPG is 703kb.

So, like… Yes, the ePub is now smaller, thank you. But I sort of expected a bigger difference, especially when the PDF has the PNG still.

1 Like

Zip the ePub. Just for testing purposes. You may be surprised.

It likely hasn’t, it just didn’t tell you.

1 Like

Zipped:
ePub: 1808kb. (so BARELY anything.)
PDF: 1853kb. (Not a lot here either, but more than the ePub.)

1 Like

Sounds reasonable. There’s only so much you can compress, and the outcome will be roughly the same (as seen in this example). What file size are you aiming for? :thinking: If “as small as possible” is paramount, you probably have to go with a rather plain (if any) cover image.

Well, ePub is basically zipped HTML with a specific extension, I wouldn’t have expected zipping it to make much difference.

That said, the fact that it is HTML under the hood means that if you use a PNG image it will include the full size PNG, which is why substituting a JPG reduces the size. How much it does so depends on the content of the image. For instance this image at 2560 x 1440 (reduced to upload here!):

is 5 MB as a PNG (75% quality), but only 271 KB as a JPG (75% quality).

The eReader or version on your computer/tablet/phone should resize any image on the fly to fit the screen size, but you still have the full-size image in the ePub. So if you really need/want to use a PNG, then use an image editor to resize it as small as will still work.

PDF is a totally different ball-game, it is essentially an image format, though can also have a copyable text-layer. As such, it doesn’t “contain” the PNG, but converts it to its own format at the size needed to display on the page.

HTH :slight_smile:

Mark

1 Like

Oh, I’m okay with any file size, basically. Was just wondering why the ePub was so much bigger when pretty much everyone and their mother say that ePubs are much smaller than PDFs. (For aforemention reasons of PDF basically being a collection of images.)

What I don’t understand, is that why did reducing the file size by ~4Mb reduce the file size by ~5Mb.

Like, now the file is ~0.8Mb for the image and ~1Mb for the rest. Before it was ~5Mb for the image and ~2Mb for the rest. Why did reducing the image size reduce the amount the “rest” took space?

There was probably more going on (in the process of making your changes) than meets the eye, but honestly impossible to tell without inspecting the files before / after.