Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 06-02-2025, 10:59 AM   #1
steveumbal
Junior Member
steveumbal began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jun 2025
Device: PocketBook Verse Pro
Png's nightmare (from my wishlist)

I've a large epub library (~100k) and it'time to slim down hd space waste.
Found that "Resize images" in the editor tools is really usefull, love it.

The module works very well with .jpeg but can't shrink down .png with the same effectiveness so I need to export all .png, convert to .jpeg with an external tool and reimport them in the editor ... ONE BY ONE.

Usually I find epub with 30-40 png, sometimes others with ~ 100 and it's a very boring job to reimport, but I can survive.

Yesterday I found a 84 mb epub with 870 .png in it, so it's for it that I write this post.

What about a NEW MODULE in the editor tool like "Transform all .PNG to .JPEG" ?


p.s.: please don't blame me about the loss of quality in the .jpeg, I'm really satisfied with the results.
steveumbal is offline   Reply With Quote
Old 06-02-2025, 11:35 AM   #2
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: 45,251
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Well you dont have to do it one by one. You can shift click to select all the png's in the editor, right click and change their extension to jpg. Then close the editor and use the unpack book tool which will give you the book contents including all image files in a folder. You can then use a simple script to actually convert the files (which are named .jpg but are actually png) from png to jpeg. Once that's done the unpack book tool will rebuild the ebook.
kovidgoyal is offline   Reply With Quote
Old 06-02-2025, 01:10 PM   #3
readx
Connoisseur
readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.
 
Posts: 91
Karma: 118402
Join Date: Jul 2009
Device: Cybook Gen3
Quote:
Originally Posted by capink View Post
A combination of Editor Chains and Action Chains lets you perform lossy compression on multiple books.

In Editor Chains, there is a an action called "Compress Images", that enables you to automate this process. You can use the Action Chains to run this for multiple books. (chain in first attachment).

If you want to use an external tool to for lossy compression, e.g. ImageMagick, which can help convert png to jpg, you can use the Run Command action which will iterate over all images in an epub. See this post and screenshots for more details. (chain in second attachment). Note however, that you might need to edit the chain to configure the path to ImageMagick on your system.

To import the attached chains: Action Chains > Add/Modify chains > right click the chains table > import > browse to the zip file.

Note: I have found the ImageMagick approach to be much faster with lossy compression compared to the first approach that uses the editor's "Compress Images". Test with both and see which is more satisfactory.

I'm wondering if that would work for you?
(The needed files are attached to the original post)
readx is offline   Reply With Quote
Old 06-03-2025, 10:23 AM   #4
steveumbal
Junior Member
steveumbal began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jun 2025
Device: PocketBook Verse Pro
Thanks, Kovid, nice advice to rename the extension in advance.
For the unpack tool I faced some troubles: it tries to open a directory in which doen't have rights to write (strange, I have administrator rights in Windosw X) and also tampering with security delay the job for every book. Is there a way to modify the path where unpack tool open epub?

Anyway I solved the problem with Total Commander in the old fashion way, now my old 84 mb epub is a nice 13 mb epub.


Quote:
Originally Posted by kovidgoyal View Post
Well you dont have to do it one by one. You can shift click to select all the png's in the editor, right click and change their extension to jpg. Then close the editor and use the unpack book tool which will give you the book contents including all image files in a folder. You can then use a simple script to actually convert the files (which are named .jpg but are actually png) from png to jpeg. Once that's done the unpack book tool will rebuild the ebook.
steveumbal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help: Organization Nightmare rjupiter Library Management 16 08-11-2014 10:13 PM
The Nightmare Within now just $.99! Glen Krisch Self-Promotions by Authors and Publishers 8 05-05-2011 07:41 PM
where to get autorun.xml, icon.png, key.png, lut.bin for PRS-505 obender Sony Reader Dev Corner 2 01-25-2009 03:20 PM
HP Nightmare Bob Russell Lounge 27 05-10-2007 04:37 PM


All times are GMT -4. The time now is 08:59 AM.


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