MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Sigil (https://www.mobileread.com/forums/forumdisplay.php?f=203)
-   -   File size increases when editing in Sigil (https://www.mobileread.com/forums/showthread.php?t=221509)

Claire3001 09-02-2013 11:20 AM

File size increases when editing in Sigil
 
My company had an ePub made for us and I'm editing it in Sigil on Windows Vista. It's an image heavy file, which was 26MB when I started and had about 650 photos in it. I have changed all the photos and deleted several, so I now have about 500 photos, all at the same DPI as the previous photo (150) and all less than 300Kb, totalling less than 15MB. I also changed the text on about 30 of the pages, but now the file size of my ePub is 86MB. Does anyone know what's happened to make it so big?

mrmikel 09-02-2013 11:59 AM

Have the old files been deleted not just from the text but from the epub itself?

Are the old files shown in the book browser?

phossler 09-02-2013 12:01 PM

MS Office does things like also

I rename (for example) a XLSM to .zip and open the now zip file to look for clues as to what's taking all the space

Epubs are really zip files in disguise, so that might work for you to get a clue as to what's taking all the space

Paul

theducks 09-02-2013 12:02 PM

AFAIK Sigil does nothing but import images
Look at the code(view) for clues.
Tidy (if enabled) will fix malformed code with inline styles.
If you see much (inline) other than class="xyzzy", your original XHTML decelerations were substandard and got worked around :rolleyes:

Toxaris 09-02-2013 02:07 PM

Probably the new images are larger in size and not optimized.

crich70 09-03-2013 10:18 AM

Also even if the image is removed from the text if it isn't removed from the 'image' folder as well then it is still there to take up room. What I can't figure out is why the file size doubles in size when I convert the epub to Kindle format.

phossler 09-03-2013 11:08 AM

Quote:

What I can't figure out is why the file size doubles in size when I convert the epub to Kindle format.
http://velluminous.com/handcraftedebooks/archives/78

Quote:

If you’ve worked with many ePubs and converted them with Kindlegen while paying attention to file sizes, you might well have noticed that the Kindle files are much larger than the original ePubs — typically around twice as large. It turns out that Kindlegen stashes a copy of the original ePub sources inside its output file, which explains the doubling of size. Unfortunately, this can lead to super-sized Kindle files, particularly in heavily-illustrated works, since images get duplicated along with everything else.
Paul

crich70 09-03-2013 01:26 PM

Quote:

Originally Posted by phossler (Post 2611564)

Interesting. Thanks. Had wondered what was up with that. In Sigil epubs will be one size and when I took the file and converted it (in Calibre) it usually does double in size. I imagine all conversion programs do the same. Sort of a two questions on same side of coin situation. :)

DaleDe 09-03-2013 06:41 PM

KindleGen actually will normally triple the size of the file. Inside the file is the original ePub, a Mobi version of the file and a KF8 version of the file. You can use kindlestrip to remove the copy of the source leaving you with double the size. I would not recommend reducing it further; both internal copies are usable depending on the device. The mobi version is usable on devices that support mobi and the Kindle1 and perhaps Kindle2 and I believe KindleDX while the KF8 file matches the ePub for display capabilities and is usable on all other kindle devices.

However if you are tageting only mobi version then you can use Kindleunpack to take the file apart.

Dale

Claire3001 09-04-2013 05:56 AM

Quote:

Originally Posted by phossler (Post 2611564)

Something similar happened when we converted the original file to MOBI, but when uploaded to Amazon with KDP, it reduced in size.

With regards to the original files - I deleted them all from the browser and imported the new ones into the browser. And the new files total less than 15MB, so I don't understand why it's increased by 60MB. I've not linked them all the the corresponding pages yet - could this be why it's so big?

Claire3001 09-04-2013 06:26 AM

Okay - I've had a go at unzipping the file and it turns out I was calculating the image sizes wrong, so they are too big. I need to get them all down to less than 50Kb each - any ideas about how to do this without making the quality terrible? The old images were all 150 DPI, but somehow manage to be less than 50Kb each.

Claire3001 09-04-2013 07:00 AM

Right - I tried converting them all to RGB, to create a smaller file size, but they all just got bigger - I'm so confused!

mrmikel 09-04-2013 07:37 AM

What are the files? PNG or JPG? PNGs can be hard to shrink unless you understand them well (which I don't.)

Try going back to originals and save off copies as jpgs at various quality levels and see which will be acceptable. You need to be sure you preview them at the size they will be displayed at.

Irfanview (a free program) can do bulk conversions.

PatNY 09-04-2013 08:03 AM

Claire, the two big things that will impact file sizes for jpegs are --

1) resolution -- ie, the physical dimensions of the image. For example, if you have an image with a resolution of 1200 x 800 pixels, reducing it to 600 x 400 pixels will cut the size considerably, assuming the compression level used to save the images are roughly the same.

2) jpeg compression level used -- this is an adjustable setting in the program you are using to output your jpegs. Raise the compression level to reduce file size. The actual adjustment is often called "Quality" in which case you lower the "Quality" to reduce the file size.

You can do either 1 or 2 or BOTH to reduce the file sizes of your jpegs. For image heavy books, I prefer not to touch the resolution at all (as images will then appear smaller on your device) and instead simply adjust the image compression.

To do that, I "explode" the epub using Calibre's tweak epub feature. Then I select all the jpegs in the epub's image folder and drag and drop them onto the interface of Fotosizer (a free program). I then use a compression setting of anywhere from 40 to 60 in Fotosizer to resample the images and save right back to the original folder. I can usually get up to 75% space savings (sometimes more) in some image books.

Two things to note: Compression levels (or quality settings) are different with every program -- ie, 60 in Fotosizer is different from 60 in Photoshop which is different from 60 in Irfan. Just keep that in mind if you are trying out different programs. Test the output to make sure the file size is what you want.

Another thing -- Make sure you backup your original epub before resampling images, AND only resample images once. JPEG is a lossy format, which means every time you re-save the jpeg you are losing some quality. So if you have to redo something, go back to the original images.

DPI will not impact file size ... that just sets the size of the output document if printed.

--Pat

Claire3001 09-04-2013 08:24 AM

Quote:

Originally Posted by PatNY (Post 2612703)
Claire, the two big things that will impact file sizes for jpegs are --

1) resolution -- ie, the physical dimensions of the image. For example, if you have an image with a resolution of 1200 x 800 pixels, reducing it to 600 x 400 pixels will cut the size considerably, assuming the compression level used to save the images are roughly the same.

2) jpeg compression level used -- this is an adjustable setting in the program you are using to output your jpegs. Raise the compression level to reduce file size. The actual adjustment is often called "Quality" in which case you lower the "Quality" to reduce the file size.

You can do either 1 or 2 or BOTH to reduce the file sizes of your jpegs. For image heavy books, I prefer not to touch the resolution at all (as images will then appear smaller on your device) and instead simply adjust the image compression.

To do that, I "explode" the epub using Calibre's tweak epub feature. Then I select all the jpegs in the epub's image folder and drag and drop them onto the interface of Fotosizer (a free program). I then use a compression setting of anywhere from 40 to 60 in Fotosizer to resample the images and save right back to the original folder. I can usually get up to 75% space savings (sometimes more) in some image books.

Two things to note: Compression levels (or quality settings) are different with every program -- ie, 60 in Fotosizer is different from 60 in Photoshop which is different from 60 in Irfan. Just keep that in mind if you are trying out different programs. Test the output to make sure the file size is what you want.

Another thing -- Make sure you backup your original epub before resampling images, AND only resample images once. JPEG is a lossy format, which means every time you re-save the jpeg you are losing some quality. So if you have to redo something, go back to the original images.

DPI will not impact file size ... that just sets the size of the output document if printed.

--Pat

My photos are all JPEGs, 500x285 pixels. I re-saved them all in RGB format, which cut the overall size by about 20MB. I will try going back and convert to RGB and lowering the 'Quality' setting (I'm using Photoshop). Thanks for the help.


All times are GMT -4. The time now is 07:50 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.