Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 06-14-2021, 04:50 PM   #1
endemion06463
Enthusiast
endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.
 
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.
endemion06463 is offline   Reply With Quote
Old 06-14-2021, 09:47 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,809
Karma: 54830978
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)
theducks is offline   Reply With Quote
Advert
Old 06-14-2021, 10:36 PM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
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.
kovidgoyal is offline   Reply With Quote
Old 06-16-2021, 12:49 PM   #4
endemion06463
Enthusiast
endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.
 
Posts: 32
Karma: 2137662
Join Date: Apr 2019
Device: Likebook P78
Quote:
Originally Posted by theducks View Post
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)
That only seems to work for the cover image.

Quote:
Originally Posted by kovidgoyal View Post
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.
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.
endemion06463 is offline   Reply With Quote
Old 09-03-2021, 05:36 AM   #5
TranHoang
Junior Member
TranHoang began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Sep 2021
Device: Kobo Libray H2O, Kindle PW3
Quote:
Originally Posted by endemion06463 View Post
That only seems to work for the cover image.


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.
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.
TranHoang is offline   Reply With Quote
Advert
Old 09-16-2021, 09:53 AM   #6
endemion06463
Enthusiast
endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.
 
Posts: 32
Karma: 2137662
Join Date: Apr 2019
Device: Likebook P78
Quote:
Originally Posted by TranHoang View Post
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.
Doesn't work. Well maybe it does as in reducing the resolution of the images but it does nothing for the file sizes.

We really need bulk image compression in the book editor instead of workarounds that sort of do something similar.
endemion06463 is offline   Reply With Quote
Old 09-16-2021, 11:49 AM   #7
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,809
Karma: 54830978
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)
theducks is offline   Reply With Quote
Old 09-18-2021, 02:22 PM   #8
endemion06463
Enthusiast
endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.
 
Posts: 32
Karma: 2137662
Join Date: Apr 2019
Device: Likebook P78
Quote:
Originally Posted by theducks View Post
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)
Sorry I was wrong things are happening but it's hidden. The books shown in Calibre keep showing the original file size after conversion (it keeps an original version or something?). It's confusing. How do I replace my epub files with the converted version? Anyone care to write a step by step instruction set?

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.
endemion06463 is offline   Reply With Quote
Old 09-25-2021, 11:24 AM   #9
endemion06463
Enthusiast
endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.
 
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!?
endemion06463 is offline   Reply With Quote
Old 09-25-2021, 11:33 AM   #10
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
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.
kovidgoyal is offline   Reply With Quote
Old 09-25-2021, 05:14 PM   #11
endemion06463
Enthusiast
endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.endemion06463 ought to be getting tired of karma fortunes by now.
 
Posts: 32
Karma: 2137662
Join Date: Apr 2019
Device: Likebook P78
Quote:
Originally Posted by kovidgoyal View Post
You probably have your tempdir in ram, move it out or set CALIBRE_TEMP_DIR somewhere else.
I have no idea how to do that.

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.
endemion06463 is offline   Reply With Quote
Old 02-28-2024, 11:41 AM   #12
MohaMadi
Junior Member
MohaMadi began at the beginning.
 
MohaMadi's Avatar
 
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!
MohaMadi is offline   Reply With Quote
Old 03-04-2024, 03:33 AM   #13
MohaMadi
Junior Member
MohaMadi began at the beginning.
 
MohaMadi's Avatar
 
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.
MohaMadi is offline   Reply With Quote
Old 03-04-2024, 04:37 AM   #14
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,809
Karma: 54830978
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
theducks is offline   Reply With Quote
Old 04-08-2024, 02:42 PM   #15
peekpoke
Enthusiast
peekpoke began at the beginning.
 
Posts: 41
Karma: 10
Join Date: Dec 2013
Device: Kindle/Android
Quote:
Originally Posted by theducks View Post
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
Unfortunately the Polish tool doesn't allow lossy compression.
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.
peekpoke is offline   Reply With Quote
Reply

Tags
batch, compress, images


Forum Jump

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


All times are GMT -4. The time now is 07:17 AM.


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