06-14-2021, 04:50 PM | #1 |
Enthusiast
Posts: 32
Karma: 2137662
Join Date: Apr 2019
Device: Likebook P78
|
Compress images
The Calibre editor has this handy feature to "compress images losslessly" and it's especially great that there is an option to not compress is losslessly. I like light novels but lately they have been getting out of hand with their image sizes sometimes my ereader even has trouble loading them. I mean a light novel usually has 40k-50k words (aprox 200 pages). They really don't need to be over 40MB just because some (usually less than 20) drawings are saved as if they are high quality photo's. Jpeg's saved at best quality but drawings don't need that, you can hardly tell the difference between max quality and 25%
Is there a way to apply this feature to a batch of epub files? If not where can I put a feature request? If this feature was available in the batch convert panel you could do epub to epub and then enable image compression. Personally I would like it the most if I could select a folder where the program then scans for all epub files including the sub-folders, then lists them and the available compression settings with an apply button to start the proces. |
06-14-2021, 09:47 PM | #2 |
Well trained by Cats
Posts: 30,121
Karma: 57500000
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Bulk mode Metadata Edit. The setting is near the bottom.
Also: If you set your profile for your device, the resizes the COPY SENT only. (output profile is mostly about images) |
Advert | |
|
06-14-2021, 10:36 PM | #3 |
creator of calibre
Posts: 44,154
Karma: 22670164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The Polish books tool will doit for you in bulk. Preferences->Toolbars and add the tool to you r main toolbar. Notethat it only does lossless, not lossy compression.
|
06-16-2021, 12:49 PM | #4 | |
Enthusiast
Posts: 32
Karma: 2137662
Join Date: Apr 2019
Device: Likebook P78
|
Quote:
That it only allows lossless compression defeats the point. I only got like a ±3% reduction. So I guess we're back to feature requesting. Thanks anyway. |
|
09-03-2021, 05:36 AM | #5 |
Junior Member
Posts: 1
Karma: 10
Join Date: Sep 2021
Device: Kobo Libray H2O, Kindle PW3
|
I ran into this issue today and I found out that you can set conversion profile to your device, then re-convert your library (EPUB to EPUB in my case). Calibre will reduce the size of images for you.
|
Advert | |
|
09-16-2021, 09:53 AM | #6 | |
Enthusiast
Posts: 32
Karma: 2137662
Join Date: Apr 2019
Device: Likebook P78
|
Quote:
We really need bulk image compression in the book editor instead of workarounds that sort of do something similar. |
|
09-16-2021, 11:49 AM | #7 |
Well trained by Cats
Posts: 30,121
Karma: 57500000
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
If you have PREVIOUSLY converted that title: Preferences does not affect THOSE books as calibre remembers the PER BOOK usage so as to allow fine tuning.
The DIALOG AT THE START OF EACH CONVERSION shows the previous settings and allows those to be updated. (there is also a tick box in the bulk mode or button in single mod that clears previous settings and pulls the current preferences) |
09-18-2021, 02:22 PM | #8 | |
Enthusiast
Posts: 32
Karma: 2137662
Join Date: Apr 2019
Device: Likebook P78
|
Quote:
By the way unrelated to above, I've noticed that it's supprisingly hard to find modern fonts that properly differentiate between capital I and lower case l. If you happen te know a good font or two that does it properly let me know. |
|
09-25-2021, 11:24 AM | #9 |
Enthusiast
Posts: 32
Karma: 2137662
Join Date: Apr 2019
Device: Likebook P78
|
So I let calibre scan my light novel folder. It adds the books to calibre. Well actually it's copying them into calibre's library aka calibre's program folder. Which messes up the filename by the way. And takes forever...
There are 917 books in the library afterwards. There is a file number discrepancy there, as there are 937 files (±12GB) all .epub and a few .txt. So what's happening there? So now I go ahead and convert them from epub to epub in bulk. Then it starts queuing, which also is slow. But worst yet at 67% it claims "device has no more room". So first I thought I ran out of disk space. So I moved calibre (portable) to a larger partition (with at least a few hundred GB's free). Well that turned out to be unnecessary as the same thing happened again. Seems like it can only que a limited number of books. Kinda weird for a bulk feature. So now I'm doing it in steps. First I tried 444 well didn't work same error. Then I tries 100, that worked, then I tried 200, also worked. Now I'm trying 300. So lets say, after finishing all that. Then what? How do I get those converted files back to where they originally came from!? |
09-25-2021, 11:33 AM | #10 |
creator of calibre
Posts: 44,154
Karma: 22670164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You probably have your tempdir in ram, move it out or set CALIBRE_TEMP_DIR somewhere else.
|
09-25-2021, 05:14 PM | #11 | |
Enthusiast
Posts: 32
Karma: 2137662
Join Date: Apr 2019
Device: Likebook P78
|
Quote:
After spending hours copy pasting all those "converted" files back in their original folders and removing the old ones. Save to disk: Save only EPUB to disk in a single folder. It doesn't do what it says as it results in 3 file's per book to appear in that folder (cover.jpg, metadata.opf and the actual .epub file). Well it was rather challenging as the filenames aren't preserved trough this method. So that's rather messy now. Also some files got messes up I haven't checked all of them of course but what I did see was that some got extra pages inserted one even had all the images cut into horizontal section. I also did some testing convert vs the editor's image compression. Well even though the convert method reduced 12GB to 1.8GB, the image compression method is even more efficient at least for the files that I tested, there was at least an extra 40% reduction and no messed up file names (and no other mess ups). So PLEASE add bulk functionality to the editor's image compression function. |
|
02-28-2024, 11:41 AM | #12 |
Junior Member
Posts: 4
Karma: 10
Join Date: Feb 2024
Device: none
|
As for batch processing in Calibre, I'm not sure if it's possible, but it would be awesome if they could add that feature to the batch convert panel. Imagine having a folder scan option, listing all epubs, and letting you choose compression settings for a bulk apply – that would be a game-changer!
|
03-04-2024, 03:33 AM | #13 |
Junior Member
Posts: 4
Karma: 10
Join Date: Feb 2024
Device: none
|
The Calibre editor's image compression feature is a lifesaver, but I wish it was easier to apply it to a bunch of epubs at once.
|
03-04-2024, 04:37 AM | #14 |
Well trained by Cats
Posts: 30,121
Karma: 57500000
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
It is easy.
Use the polish tool (compress is one of the options)from the main toolbar (you may need to add the icon. Preferences : toolbars |
04-08-2024, 02:42 PM | #15 | |
Enthusiast
Posts: 41
Karma: 10
Join Date: Dec 2013
Device: Kindle/Android
|
Quote:
It's hardcoded into the source code to NEVER reduce the quality. calibre/src/calibre/ebooks/oeb/polish/images.py The code says either losslessly re-encode (using optimize_jpeg), or recompress using the same quality (using encode_jpeg). elif self.jpeg_quality is None: func = optimize_jpeg else: func = partial(encode_jpeg, quality=self.jpeg_quality) To force it to use Quality 50, I made this change in my local source, removing elif self.jpeg_quality part. else: func = partial(encode_jpeg, quality=50) After that change it appears to reduce using polish. Got a drastic reduction in file size. Unfortunately you cannot specity which format to polish, so if perhaps you want to reduce all the AZW3 for kindle, but want to keep original EPUB, it's a hassle of restoring the EPUBs. |
|
Tags |
batch, compress, images |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compress images losslessly | jlynton | Calibre | 9 | 04-21-2021 04:16 PM |
How to not compress jpeg | Arrandir | Sigil | 5 | 04-11-2020 06:43 PM |
Batch mode to compress images | pmichelazzo | Editor | 2 | 06-17-2018 04:33 AM |
Bug: "Polish books" fails to compress images other than cover | webmaven | Calibre | 2 | 08-19-2017 05:35 AM |
No glyph available error and cannot compress png images | crouton | Editor | 1 | 01-06-2017 10:02 PM |