06-25-2013, 04:12 AM | #1 |
Junior Member
Posts: 7
Karma: 10
Join Date: Jun 2013
Device: Kobo & Sony
|
How to reduce size of image files?
Hi!
I am using Calibre. I have in my library a lot of epub files larger than 300 ko. Mainly, this is due to image files with inappropriate size (in pixel) or quality (jpeg level compression). I would like to reduce file size (based on max image size and jpeg quality). I do not want to do it manually one by one within epub zip file. Do you have idea how to set-up caliber to help me in this mission? May be an other tool ? Thanks in advance to all of you. |
06-25-2013, 05:37 AM | #2 |
Handy Elephant
Posts: 1,736
Karma: 26785668
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Thinkpad E595, Ubuntu Mate, Huawei Mediapad 5, Bouye Likebook Plus
|
The easiest way would most likely be to convert the books with an appropriate output profile. Calibre will then resize the images to fit on the device selected as output profile. Use a device with a small screen as output profile. Do some testing.
You convert epub to epub. I don't know if polish is enough? Might try it? https://www.mobileread.com/forums/sho...d.php?t=191906 |
Advert | |
|
06-25-2013, 07:44 AM | #3 |
Junior Member
Posts: 7
Karma: 10
Join Date: Jun 2013
Device: Kobo & Sony
|
Thanks for your quick advice.
I tried but it is not very optimized: Small screen size = Microsoft Reader (seems to be) Original image = 459 x 747 (161 KB) New image after export = 392 x 638 (126 KB) Manually, Reduce jpeg quality compression by 50% without resize, new weigh is 55 KB! |
06-25-2013, 08:14 AM | #4 |
Handy Elephant
Posts: 1,736
Karma: 26785668
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Thinkpad E595, Ubuntu Mate, Huawei Mediapad 5, Bouye Likebook Plus
|
To do that you would most likely have to hack the source code for calibre. Easier to do it manually as you just did...
|
06-25-2013, 10:37 AM | #5 |
Guru
Posts: 644
Karma: 1242364
Join Date: May 2009
Location: The Right Coast
Device: PC (Calibre), Nexus 7 2013 (Moon+ Pro), HTC HD2/Leo (Freda)
|
You might be able to find some bulk image editing or converter software that does what you want. No specific software comes to mind but someone might offer something that would automate the process a bit. I would suggest checking download sites and/or your favorite search engine.
|
Advert | |
|
06-25-2013, 10:46 AM | #6 |
Grand Sorcerer
Posts: 12,619
Karma: 74358024
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
What I have done is to use the Tweak ePub to explode the book, then Irfanview to resize / resample all the images (with the option to place them back in the original locations), followed by letting Tweak ePub rebuild the book.
I've found this to be very useful especially when transferring cookbooks with massive, full colour images to an eReader. |
06-25-2013, 12:32 PM | #7 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Hi
This Linux bash script let you bulk resize jpg images to a 600x800 pixels resolution. It creates a new folder named "reduced". It can be launched by a right click (nautilus-script or similar). It uses convert from Imagemagick. If you wish a different resolution or apply it to a different image format, open the script and change the relevant information. Spoiler:
|
06-25-2013, 06:18 PM | #8 |
null operator (he/him)
Posts: 20,938
Karma: 27620688
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
The FastStone program - MaxView for Windows is an image viewer that reads ZIPs and RAR's - it can do simple jpeg edits such as rotates, flips, and resize with compression.
Its not freeware and it may not work on EPUBS - but it might be worth a try. Oh, an EPUB file is a ZIP'd folder. Addenda - I just had a brief play - Maxview doesn't have the facility replace the original image with the edited image within the archive, it must be saved elsewhere; and there are no bulk operations; and the development of product seems to have ceased, last update June 2011. So its probably not suited to this task. I hadn't used its editing features previously. Aaah, well its the thought that counts - Maxview is still a good viewer if like me you prefer to have image-sets in archives rather than individual files in individual folders. BR Last edited by BetterRed; 06-25-2013 at 07:25 PM. Reason: Addenda |
06-25-2013, 07:11 PM | #9 |
Zennist
Posts: 1,022
Karma: 47809468
Join Date: Jul 2010
Device: iPod Touch, Sony PRS-350, Nook HD+ & HD
|
I frequently "compact" epubs by compressing jpegs further and optimizing PNGs. Here's the fastest way I've found to do it:
1) Explode the epub using Calibre's tweak book feature. 2) Navigate to the images folder and select all. Drag and drop them onto the interface of Fotosizer, a free batch photo resizing program. 3) Set the compression level. I usually set it to 55 but you can go lower if you want even smaller files. Adjust the resize settings if you want. I usually keep all my images at their original resolution (default setting) as I'd prefer more compressed jpegs over lower-res photos. 4) Set the destination directory -- I just always use "same as original" 5) Click "Start" and in about a minute or less, all the images you selected will be resampled and compressed. 6) Rebuild the book. You should now have a book that is significantly smaller than the original. On a 55 setting, I can get space savings of up to 70% or more. If the images are PNGs, I use PngGauntlet. It is also free, and you also can just drag and drop your images onto the interface and batch process them. However, since optimizing PNGs takes far longer than resampling jpegs, the process can take up to an hour or more, depending on how many PNGs are in your book. Since I don't like to leave a book "exploded" in calibre for a long time, for PNGs I will just copy the originals onto a folder on my desktop. I then optimize them from there. When it's done, I just replace the originals in the exploded book with the optimized ones. The space savings with PNGs is not as great as you can get with jpegs. Maybe 10-20%. --Pat Last edited by PatNY; 06-25-2013 at 07:14 PM. |
06-26-2013, 05:19 AM | #10 |
Junior Member
Posts: 7
Karma: 10
Join Date: Jun 2013
Device: Kobo & Sony
|
Thanks all for your suggestions.
My main concern is to do that on all my epub files in one time and not one by one I tried to explore the zip solution: - I add a new extension (.zip) to all my epub files (one click with the right software) - Now all epub files are seen as zip folder by Windows and I can navigate inside as if it is simple folder. Next step is to find the way to resize pictures (batch mode) inside these “zip” folders. I tried without success: Photoshop, ACD See, Faststone (MaxViewer, Viewer & Resize). Next try with Fotosizer. Any others ideas? A simple question but no a so easy answer |
06-26-2013, 08:45 AM | #11 | |
null operator (he/him)
Posts: 20,938
Karma: 27620688
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Copy the epubs to a folder on your desktop eg EPUBRESIZE - unzip them into subfolders. Then use a script (see Roger64 post) that walks the EPUBRESIZE folder tree and does the resize and compression with the imagemagick convert command Google will find imagemagick FOR /R will walk a folder tree in a batch file When convert is all done, create new ZIPs from the subfolders with the resized pictures, rename them to EPUB and put them back into their calibre folders. Obviously backup the library first and test on a few books BR |
|
06-26-2013, 09:21 AM | #12 |
Grand Sorcerer
Posts: 12,619
Karma: 74358024
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
Becareful with the rezipping; don't forget there are very special rules for the internal layout of the ePub file.
|
06-26-2013, 11:38 AM | #13 | |
Zennist
Posts: 1,022
Karma: 47809468
Join Date: Jul 2010
Device: iPod Touch, Sony PRS-350, Nook HD+ & HD
|
Quote:
--Pat |
|
06-26-2013, 08:03 PM | #14 | |
null operator (he/him)
Posts: 20,938
Karma: 27620688
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
I did not change any files other than the images, nor any file names, I also retained the timestamps on the image files. I used Winrar to unzip and rezip the folders - as far I can tell they're fine, as an extra test I converted the rezipped EPUBs to AZW and RTF, they work fine in Kindle for PC, MS Word and OOo Writer. I'd be very wary of using the process on anything other than the image files, eg the HTML, or XML components. But in the context of an EPUB, images are binary blobs that don't in themselves reference any other EPUB components. So providing one is careful then the process should work. A "Squeeze Images" plugin would be nice. BR |
|
06-26-2013, 08:19 PM | #15 | |
Grand Sorcerer
Posts: 12,619
Karma: 74358024
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
You mean like this request?
Quote:
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to reduce size of opf file??? | karenbryant | ePub | 28 | 10-10-2022 12:39 PM |
18MB EPUB converts to 40MB Mobi! What can I do to reduce Mobi file size? | perdman | Conversion | 11 | 12-09-2017 04:18 AM |
Best image size for cover? | Alda | ePub | 1 | 03-20-2013 02:08 PM |
How do I reduce popup size for cover selection? | lizzielou | Calibre | 2 | 05-06-2012 04:41 AM |
Image Size | benjaminsolah | ePub | 13 | 09-24-2010 11:47 PM |