03-08-2023, 10:18 AM | #1 |
Zealot
Posts: 126
Karma: 10
Join Date: Nov 2021
Device: Kobo Libra 2
|
Problem with large png image
Since Calibre doesn't seem to have the native capacity to compress png files, but just hangs for ages trying to do so but failing, I routinely convert png files to jpg, using ImageMagick - usually (maybe 80% of the time) without a problem, using the following steps:
1. Export png image(s) to a separate folder. 2. Change file extension within ebook for those images to jpg. 3. Delete the images from the ebook. 4. Convert exported png files to jpg. 5. Import new jpg images back into the ebook. I often have trouble, though, with some png files even after this procedure, which as far as I can work out should do the job. The images concerned don't show up properly in the book - just empty boxes where they should be. Is there a step I'm missing out? Thanks in advance! |
03-08-2023, 10:28 AM | #2 |
creator of calibre
Posts: 43,842
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
1. Convert your PNG to JPEG however you like
2. Right click on the PNG file in the files browser in the editor and choose replace this file with and select your JPEG file |
03-08-2023, 11:06 AM | #3 |
Zealot
Posts: 126
Karma: 10
Join Date: Nov 2021
Device: Kobo Libra 2
|
Many thanks for this - works like a charm.
Does it mean, though, that there's no way to batch-replace png files with jpg? Do you have to do so one image at a time? Because some of the books I'm dealing with have dozens of png files, sometimes more. |
03-08-2023, 11:21 AM | #4 |
Zealot
Posts: 126
Karma: 10
Join Date: Nov 2021
Device: Kobo Libra 2
|
(Just signed up as a patron, by the way!)
|
03-08-2023, 11:37 AM | #5 |
creator of calibre
Posts: 43,842
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
1. select all files
2. right click 3. rename file extension 4. save and close 5. In calibre use the unpack book tool (press u key) 6. use whatever tool you like to do whatever you like to the image files in the resulting folder (other than renaming them of course) |
03-08-2023, 11:39 AM | #6 |
Zealot
Posts: 126
Karma: 10
Join Date: Nov 2021
Device: Kobo Libra 2
|
Great - thanks.
|
03-08-2023, 01:40 PM | #7 | |
Addict
Posts: 384
Karma: 1638210
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Ubuntu, Jutoh,Kobo Forma
|
Quote:
Export all the png's to a folder Convert them with ImageMagick In the Editor, delete all the png's Import all the new jpg's Do search and replace in the Editor across all text files to change .png to .jpg Then I can use Calibe's lossy compression on them all. I almost never have a problem with this. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Custom Chapter Glyphs (png image) help! | Ecredes | ePub | 5 | 02-07-2022 04:40 PM |
glib.GError: Image tpye 'png' is not supported | maggch | Kindle Developer's Corner | 1 | 01-03-2017 08:53 AM |
svg image on top of a background png image | roger64 | ePub | 25 | 04-24-2015 11:00 AM |
Display of a png image linked to a svg image | roger64 | Editor | 6 | 03-13-2015 06:21 AM |
hotlinking png image | bobcdy | Sigil | 21 | 09-21-2010 04:56 AM |