![]() |
#1 |
Enthusiast
![]() 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! |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Enthusiast
![]() 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 |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,259
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
![]() |
#5 |
Enthusiast
![]() 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 |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#7 |
Enthusiast
![]() 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...
|
![]() |
![]() |
![]() |
#8 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |