Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 12-02-2022, 06:00 PM   #1
SlowReader23
Junior Member
SlowReader23 began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Nov 2022
Location: Los Angeles, California
Device: MacBook
ePub File Compression

How do I easily compress a large ePub file from 132mb down to 10mb without losing image resolution (there are about 58 images and those have already been compressed minimizing the whole document from 162mb to 132mb)?
SlowReader23 is offline   Reply With Quote
Old 12-02-2022, 06:11 PM   #2
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,069
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Assuming the images are what is causing this HUGE file size:
I just need to ask - Those are all unique images, correct?? You'd be surprised how many times I've seen the same image duplicated multiple times because it is used multiple times in the ePub...

The next thing I would check is the resolution and size of the images. They don't really need to be super high resolution 3000x5000 images in an ePub. If they are artwork or some such then you could always have a link to a website with the higher resolution images if the reader wanted to see them.

I tend to keep the cover images (which are usually the highest resolution image in the book) to abt 500kb 1300x2200 or less.

If it is NOT (just) the image size - I would make sure you subset any fonts and clean any code bloat from the html pages. Oh...and get rid of any unused styles in the CSS. (there's a plugin for that)

Even when I have ePubs with a lot of images, I usually can get the total filesize to 1.5mb or less.

Last edited by Turtle91; 12-02-2022 at 06:17 PM.
Turtle91 is online now   Reply With Quote
Advert
Old 12-02-2022, 08:46 PM   #3
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 34,537
Karma: 144552660
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
You may also want to check calibre's ability to re-compress image files. Open the file with the calibre ebook-editor, click on Tool => Compress images losslessly. Works quite well and can give a surprising amount of space savings depending on the images.
DNSB is online now   Reply With Quote
Old 12-09-2022, 12:43 PM   #4
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,447
Karma: 157030631
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by SlowReader23 View Post
How do I easily compress a large ePub file from 132mb down to 10mb without losing image resolution (there are about 58 images and those have already been compressed minimizing the whole document from 162mb to 132mb)?
In my experience, which is pretty broad, there is no magic way to reduce/compress images and not "lose" image resolution. The best solution I've found for it, over the years, is TinyPNG, changing 300dpi images to, say, 96 dpi, but at the same time, removing any unused, but space-eating pixels. That gives me the best, most-zoomable result.

I would second Turtle's discussion with you about pixel dimensions, too. I see a lot of eBooks that have massively oversized images in them for no good reason. These tend to come out of InDesign, particularly.

Once you've fixed the dimensions, which probably are biting you a bit (not certainly, but probably) you can try TINYPNG and see if that gets you closer to where you need to be.

Although...look, I've done a lot of resizing and compressing over the years. 132mb to 10mb? That's... you're not going to get there, without some quality loss. You're simply not and you need to accept that before you start.

Hitch
Hitch is offline   Reply With Quote
Old 12-09-2022, 01:36 PM   #5
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,654
Karma: 127838196
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
What I do is if the images are larger enough then 1600 lines, I reduce down to 1600 lines. If they are not JPG, make then JPG. In Calibre, you can do a lossless compression to remove any rubbish in the images.

If there are embedded fonts, in Calibre, you can do a font subset to reduce the size of the fonts and remove any unused fonts.

Once you have the eBook as small as possible and it's still too large, then solution from there is to just deal with it as is.
JSWolf is offline   Reply With Quote
Advert
Old 12-09-2022, 01:48 PM   #6
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,447
Karma: 157030631
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by JSWolf View Post
What I do is if the images are larger enough then 1600 lines, I reduce down to 1600 lines. If they are not JPG, make then JPG. In Calibre, you can do a lossless compression to remove any rubbish in the images.

If there are embedded fonts, in Calibre, you can do a font subset to reduce the size of the fonts and remove any unused fonts.

Once you have the eBook as small as possible and it's still too large, then solution from there is to just deal with it as is.
Jon:

Man, those are all going to be tough. He has 58 images that total 132mb--you have to assume that 99% of the size is in those images--which means, on average, each image totes ~2.3mb per.

To make 10mb--total, for 58 images, that means he has to get them down to an average of 172.5KB. KILOBYTES, not MB.

The degradation will be real. We just took a run at a job like this, and I had to tell the customer that the quality he wanted could not be done, not for under 100kb per. It just couldn't.

Let's see, 10mb. Is that NetGalley?

Hitch
Hitch is offline   Reply With Quote
Old 12-09-2022, 05:07 PM   #7
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,654
Karma: 127838196
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Hitch View Post
Jon:

Man, those are all going to be tough. He has 58 images that total 132mb--you have to assume that 99% of the size is in those images--which means, on average, each image totes ~2.3mb per.

To make 10mb--total, for 58 images, that means he has to get them down to an average of 172.5KB. KILOBYTES, not MB.

The degradation will be real. We just took a run at a job like this, and I had to tell the customer that the quality he wanted could not be done, not for under 100kb per. It just couldn't.

Let's see, 10mb. Is that NetGalley?

Hitch
If you reduce the images in size if they are large enough and then lossless compress plus if there are fonts and you subset them, that's going to be as small as possible unless the images are not JPG. Then converting to JPHG and lossless compress will be as small as possible.

I doubted that the ePub would get down to 10MB in size. That my I said to deal.

One other thing I thought of that would help some. If the images are grayscale but using a 24-bit palette, setting to grayscale will reduce a the size a little.
JSWolf is offline   Reply With Quote
Old 12-09-2022, 05:13 PM   #8
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,447
Karma: 157030631
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by JSWolf View Post
If you reduce the images in size if they are large enough and then lossless compress plus if there are fonts and you subset them, that's going to be as small as possible unless the images are not JPG. Then converting to JPHG and lossless compress will be as small as possible.

I doubted that the ePub would get down to 10MB in size. That my I said to deal.

One other thing I thought of that would help some. If the images are grayscale but using a 24-bit palette, setting to grayscale will reduce a the size a little.
Fonts? Jon, dear, I think you're dreaming. Nobody said anything about fonts like in memes. I suspect that these are regular old images.

As I said, I had a similar inquiry a few months back, and I had to turn it down. Oh, sure, I could have taken it, been paid, and then listened to him gripe when he saw them, but geeeze, who wins that? That's a bad idea, so...I declined. if someone else took it, god love a duck, but you can't take images from 3-5mb and reduce them to 90-150kb and expect lossless perfection. Ya just can't.

Hitch
Hitch is offline   Reply With Quote
Old 12-09-2022, 05:17 PM   #9
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,654
Karma: 127838196
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Hitch View Post
Fonts? Jon, dear, I think you're dreaming. Nobody said anything about fonts like in memes. I suspect that these are regular old images.

As I said, I had a similar inquiry a few months back, and I had to turn it down. Oh, sure, I could have taken it, been paid, and then listened to him gripe when he saw them, but geeeze, who wins that? That's a bad idea, so...I declined. if someone else took it, god love a duck, but you can't take images from 3-5mb and reduce them to 90-150kb and expect lossless perfection. Ya just can't.

Hitch
He didn't say there were no embedded fonts. I'm just giving an option in case there are embedded fonts.

The worst company for embedded fonts is Penguin Random House. They embed fonts just for one really useless page all the time. So all of their eBooks are larger then they should be.
JSWolf is offline   Reply With Quote
Old 12-10-2022, 05:20 AM   #10
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 10,784
Karma: 83992591
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
If you fill a house with random penguins the work quality suffers.
Quoth is offline   Reply With Quote
Old 12-10-2022, 05:35 AM   #11
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,654
Karma: 127838196
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Quoth View Post
If you fill a house with random penguins the work quality suffers.
No worse then random eBook creators who use random crappy software.
JSWolf is offline   Reply With Quote
Old 12-10-2022, 10:31 AM   #12
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,069
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Quote:
Originally Posted by JSWolf View Post
What I do is if the images are larger enough then 1600 lines, I reduce down to 1600 lines. If they are not JPG, make then JPG. In Calibre, you can do a lossless compression to remove any rubbish in the images.
JPG format may indeed be the best option for the smallest file size - for certain types of images, like color photographs, paintings, etc. Other formats, like PNG or GIF, can be better for simpler images like diagrams. And (well made) SVG can be super small.

A decent software (I use photoshop but there are plenty of good ones out there) will give you a preview with filesize for different formats - all you need to do is pick the one that best fits that style of image.

Quote:
Originally Posted by JSWolf View Post
If there are embedded fonts, in Calibre, you can do a font subset to reduce the size of the fonts and remove any unused fonts.
Sigil also has plugins for removing rubbish in JPG (JPEGOptimizer) and for subsetting your fonts (SubsetFonts).
Either program works well!
Turtle91 is online now   Reply With Quote
Old 12-10-2022, 10:43 AM   #13
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,447
Karma: 157030631
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by Turtle91 View Post
JPG format may indeed be the best option for the smallest file size - for certain types of images, like color photographs, paintings, etc. Other formats, like PNG or GIF, can be better for simpler images like diagrams. And (well made) SVG can be super small.

A decent software (I use photoshop but there are plenty of good ones out there) will give you a preview with filesize for different formats - all you need to do is pick the one that best fits that style of image.



Sigil also has plugins for removing rubbish in JPG (JPEGOptimizer) and for subsetting your fonts (SubsetFonts).
Either program works well!
Well, all of that is true--but I still say that trying to go from about 2.5mb per image, to 175kb each, is not going to go well, "without losing image resolution."

As I said, we just tried to do something similar and eventually, the client gave up. I'd warned him that it wouldn't, and as it happened, yes, I ended up wasting my time on demos/samples, but at least I didn't end up with an unhappy client thinking I'd sandbagged him or the like.

Hitch
Hitch is offline   Reply With Quote
Old 12-10-2022, 10:59 AM   #14
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,069
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Quote:
Originally Posted by Hitch View Post
Well, all of that is true--but I still say that trying to go from about 2.5mb per image, to 175kb each, is not going to go well, "without losing image resolution."

As I said, we just tried to do something similar and eventually, the client gave up. I'd warned him that it wouldn't, and as it happened, yes, I ended up wasting my time on demos/samples, but at least I didn't end up with an unhappy client thinking I'd sandbagged him or the like.

Hitch
Oh - no argument from me on that part! I was just correcting Jon's statement that everything had to be JPG format.
Turtle91 is online now   Reply With Quote
Old 12-10-2022, 11:55 AM   #15
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by Hitch View Post
but I still say that trying to go from about 2.5mb per image, to 175kb each, is not going to go well, "without losing image resolution."
That depends on why it's 2.5 MB to start with. It wouldn't be the first time I see images as tiff or bmp... (although probably not in an ePub, where they are formally not allowed).
Jellby is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compression of space between lines of text decreases readability - MsWord to epub Denwayz Conversion 11 04-20-2018 07:06 PM
Epub file readers to test the created epub file. kalees ePub 1 01-21-2014 03:25 AM
HTML to EPUB - Cailbre Image Compression Kevsgreat Conversion 3 05-21-2011 08:29 PM
Opus Updating EPUB file won't change publisher data on file listing spaze Bookeen 1 03-08-2011 01:34 AM
ePub compression gonzule ePub 3 10-25-2008 03:35 PM


All times are GMT -4. The time now is 03:43 PM.


MobileRead.com is a privately owned, operated and funded community.