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 03-05-2015, 04:55 PM   #1
Achilles
Enthusiast
Achilles began at the beginning.
 
Posts: 27
Karma: 32
Join Date: Aug 2009
Device: Kindle 2
EPUB3 to PDF without recompressing JPGs?

Apologies if this is discussed elsewhere - I did some searching and came up blank.

I'm trying to convert some EPUB3 kids books into PDFs so they're readable in more places and have nearly everything working the way I want it to except for the fact that Calibre insists on recompressing the JPG background images instead of just putting them in the PDF as they are.

Is there a setting somewhere that I'm missing that will prevent recompressing of JPGs when converting to PDF?

Thanks so much!
Achilles is offline   Reply With Quote
Old 03-05-2015, 09:31 PM   #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,259
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
IIRC images are processed only if they are not already in jpeg format, if their colorspace is not RGB (thought that might be only epub not pdf, I dont recall) or their size is too large for the page.

Hard to say which if any of to say conditions your images are falling foul of without the input document.
kovidgoyal is offline   Reply With Quote
Advert
Old 03-05-2015, 11:03 PM   #3
Achilles
Enthusiast
Achilles began at the beginning.
 
Posts: 27
Karma: 32
Join Date: Aug 2009
Device: Kindle 2
The images aren't getting reduced in dimensions at all - they're the same dimensions when I open up the PDF in Photoshop and extract them back out again. They're just getting recompressed at the same size for some reason.

Can I PM you a link with an example EPUB? Would love to get this resolved so I don't have to manually replace the images in Acrobat Pro...

I also see that there are command-line options for converting to PDF - one being "--uncompressed-pdf" - would this do what I'm looking for? And, if so, is there a way to get Calibre to write out the commands it's using when using the GUI to convert an eBook so I can append them with this command and run it manually?

Thanks again.
Jared
Achilles is offline   Reply With Quote
Old 03-05-2015, 11:16 PM   #4
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,259
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
See https://www.mobileread.com/forums/sho...d.php?t=186697
kovidgoyal is offline   Reply With Quote
Old 03-06-2015, 12:05 AM   #5
Achilles
Enthusiast
Achilles began at the beginning.
 
Posts: 27
Karma: 32
Join Date: Aug 2009
Device: Kindle 2
Here's a sample showing the issue. You can see that the images embedded in the PDF have been recompressed when compared to the source JPGs inside the EPUB. (also evidenced by the smaller PDF size compared to the EPUB.)

Any insight as to how to fix it without manually replacing each image would be most appreciated.

Thanks again!
Jared


EPUB to PDF changed settings:

Look & Feel:
Disable font size rescaling
Minimum line height: 0.0%


Page Setup:
Input Profile: Default
Output Profile: Tablet
Margins: 0pt all around

Structure Detection:
Remove first image
Remove fake margins

PDF Output:
Override paper size
Custom size: 229.12x158.74 millimeter
Preserve aspect ratio of cover
Default font size: 16px
Attached Files
File Type: epub sample.epub (1.49 MB, 106 views)
File Type: pdf sample.pdf (1.08 MB, 222 views)
File Type: txt log.txt (7.4 KB, 166 views)
Achilles is offline   Reply With Quote
Advert
Old 03-06-2015, 01:11 AM   #6
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,259
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Ah that's a background image. No there is no way to prevent the processing of the image in that case. calibre's PDF engine is actually a web browser. So what happens is that the browser paints with a "background image brush" calibre intercepts that call and converts that into the equivalent PDF code, however, at this point the image has already been re-processed by the browser engine, so calibre only ever sees the re-processed image.
kovidgoyal is offline   Reply With Quote
Old 03-06-2015, 01:17 AM   #7
Achilles
Enthusiast
Achilles began at the beginning.
 
Posts: 27
Karma: 32
Join Date: Aug 2009
Device: Kindle 2
Well crap. Any way to change the compression quality? Looks like it's about an 80% JPG...
Achilles is offline   Reply With Quote
Old 03-06-2015, 02:21 AM   #8
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,259
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No, the quality is hardcoded as 94. I doubt increasing it would buy you anything.

See https://github.com/kovidgoyal/calibr...ialize.py#L456
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Epub3 XHTML Validation epub3 Ramesh Arpitha ePub 5 06-30-2014 08:32 PM
New Errors Converting epub3 -> zip -> epub3 Lola25 ePub 2 11-12-2013 09:37 PM
Viewing JPGs on Touch pwright2 Amazon Kindle 0 02-11-2012 08:04 PM
eBook Viewer recompressing in a non-standard way? capidamonte Calibre 8 06-13-2010 05:55 PM
Scribbles and Jpgs pthwaite iRex 4 03-17-2009 12:45 AM


All times are GMT -4. The time now is 12:46 PM.


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