Calibre command line
ebook-polish only allows for lossless compression of images per the documentation.
If you insist on lossy compression,
Editor Chains plugin allows you to use calibre's image compression functionality (among many other editor functions) from the command line:
- Install the plugin from calibre (Calibre main library > preferences > get plugins).
- Open the calibre editor, and then import the chain attached below (Editor > plugins menu > Editor Chains > add chains > right click > import chain).
- From the command line you can type this command to compress images in your ebook (epub and azw3 formats supported):
Code:
calibre-debug -r "Editor Chains" "Compress Images" path_to_input.epub path_to_output.epub
Note: You can configure the compression ratio by modifying the settings of the chain.