![]() |
#1 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 260
Karma: 2092424
Join Date: Oct 2011
Location: Arlington, TX
Device: Kindle PW4, Moon+ Reader on a cheap Android tablet
|
Tables in an epub?
Folks,
I am in the middle of converting a pdf to an epub. The source includes several large tables (example .jpeg attached). Currently, I'm just generating them as jpegs, but have been considering converting them to <table>s in the html. My strong intuition is that a table this wide in html isn't going to render in a sane way on any current ereader, and this isn't worth pursuing. Are jpegs the best way to go with tables like this? |
![]() |
![]() |
![]() |
#2 |
Color me gone
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
Almost always unless you can be sure they will be displayed on a large tablet. Even then somebody can increase the font size and blow up the table.
You might want to experiment with different types of images, gif, png, etc to see what gives you the best image for the least memory consumption. Probably not too big a deal if there are only a few of them. HTML tables can be hard to center as well, without messing up the formatting inside the table. Images are pretty easy to snapshot out of the pdf. Just make sure your viewer program snapshot is set to as good a resolution as you need. |
![]() |
![]() |
![]() |
#3 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 260
Karma: 2092424
Join Date: Oct 2011
Location: Arlington, TX
Device: Kindle PW4, Moon+ Reader on a cheap Android tablet
|
Thanks. There are 4 of them. I'm probably going to just stick with jpegs.
|
![]() |
![]() |
![]() |
#4 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,622
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
|
![]() |
![]() |
![]() |
#5 | ||||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
Also, if there are LOTS of images in the book, just keep in mind that all those images really start to add up in filesize. The equivalent HTML table will be MUCH smaller (and compress much better). Depending on the design of the table, you may also want to swap the x and y axis to make it more "vertical" oriented, OR split the table into multiple tables. The quickest way I have found to swapping (Transposing) an HTML table is getting all the information into a spreadsheet program (in my case, I use LibreOffice Calc), and following these steps: https://help.libreoffice.org/Calc/Ro...es_Transposing Then I can easily export as XHTML and do some quick cleanup. No JPG! PNG in this case! I have an explanation/examples here (and a link to the program that I use to compress PNGs (ScriptPNG)): https://www.mobileread.com/forums/sho...5&postcount=26 This is a pet peeve of mine.... lossless formats should be used when dealing with "artificial" images. Quote:
Also, keep in mind readers who are blind. Images of tables are completely useless to them. I prefer to have actual HTML images in the books, so that they scale with the rest of the text, and go along with all the other user preferences. Quote:
![]() The equivalent PNG will ALWAYS be smaller than GIF (PNG has less overhead). Quote:
Another thing that irks me about images of tables is when they take a tiny thumbnail image of a table that is COMPLETELY unreadable. Here is an example of a table I "verticalized" + some more JPG-PNG examples. Original Page from the PDF: Here is an image of my "verticalized" HTML table in Sigil: JPG (Grayscale 90 + 80 quality): The filesize is 82.8 KB and 65.6 KB. The artifacting in the image will only get worse from there if you want to try to aim for a "reasonable" filesize. PNG (Grayscale PNG saved right from GIMP + Compressed with ScriptPNG): The filesize is 37.8 KB and 31.3 KB. These images have ZERO artifacting, and are less than half the size of those JPGs. In the future, let us say an even better lossless filetype comes out, or an even better compression algorithm. These images can also be made even smaller with ZERO loss. Here is the PDF: http://library.mises.org/books/Willi...20Currency.pdf and I have attached the actual WIP EPUB if you want to take a look. Last edited by Tex2002ans; 09-21-2013 at 04:19 PM. |
||||
![]() |
![]() |
![]() |
#6 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,622
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
|
![]() |
![]() |
![]() |
#7 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 260
Karma: 2092424
Join Date: Oct 2011
Location: Arlington, TX
Device: Kindle PW4, Moon+ Reader on a cheap Android tablet
|
Tex2002ans,
Thanks for all the info. The pdf I am converted was downloaded from http://cybertracker.org. It was released under a creative commons license and I am converting it mainly for my own use, but might upload it to the MobileRead library. In the original pdf, I think these tables are images (not searchable or selectable as text). After some googling around, I was able to use this service: http://www.extractpdf.com to extract all of the images. These tables and several diagrams came back as .pngs, and the photgraphs are jpegs. In all, 32 images & about 2.8 Mb total. I am going just use these pngs for the tables, after trying to shrink them with the tools you recommended |
![]() |
![]() |
![]() |
#8 | ||||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
GIF is good, but PNG is great! ![]() There are only 2.5 areas where GIF has an advantage over PNG:
https://en.wikipedia.org/wiki/Portab...ompared_to_GIF For some lively discussion about the topic: http://stackoverflow.com/questions/1...ges-gif-or-png There is only one bug that you have to keep in mind with PNG images (only applicable to Kindles): Kindlegen cannot handle transparency in PNGs (converts transparency to a black background). I have not stumbled upon one case of an artificial image (table, chart, diagram, figure) where GIF was better than PNG. PNG can handle every case where a GIF can be used, PLUS more. Quote:
The company that I work for, everything is CC3.0 (or public domain). Most of my EPUB work is done OCRing PDFs of older book scans (Black & White), but I also help convert newer publications as well (so I deal with color charts/graphs/diagrams... and if I am lucky, I get the actual vector source (Those nice charts I had in my ScriptPNG post were generated from the vector files) ![]() Quote:
![]() I mean.. why would you want to lower the quality of your EPUB version because of someone making a bad decision when they exported the PDF? (exporting tables/charts/graphs as non-vector formats). If the author is still alive, and this PDF was created recently (within the last few decades)... perhaps try to get in contact with the author himself. Perhaps he still has the source files sitting around, and you can generate higher quality tables! Quote:
Here is a real life example of the horrible conversion/JPG artifacting you might run into (and the HUGE filesize of JPG compared to PNG): Original image was done by the author, and was probably generated by some sort of crappy PDF -> image conversion (800+ KB JPG). Artifacting left and right, and that filesize should make you gasp!! I got the source document from the author, and was able to generate a PNG (42.9 KB)): I must admit, it was a "lossy" PNG conversion since I Indexed it to 4 gray colors. Grayscale JPG (90 quality) (257 KB): Grayscale JPG (80 quality) (203 KB): Artifacts between PNG + 90 JPG + 80 JPG: As you can see, the "halo"ing gets worse and worse the lower quality you go with JPG. A GIF would look exactly like the PNG version (no haloing artifacts), BUT the GIF will have a larger filesize. Anyway, this entire topic reminded me of this book with a very large Appendix FULL of tables. One of these days, I will go back and "verticalize" them. PDF Scan: EPUB with Images of Tables: EPUB with HTML Tables: The HTML table also has the advantage of footnotes being linked back/forth. I can attach both versions of the EPUBs if anyone is interested. EPUB with images: 1.41 MB EPUB with HTML: 611 KB Side Note: PDF is just about the WORST format to work backwards from. Last edited by Tex2002ans; 09-22-2013 at 12:50 AM. |
||||
![]() |
![]() |
![]() |
#9 | |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,542
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
GIF is only okay-ish: No real alpha channel, only 256 colors. The later is not much relevant for grayscale images, but the former can make a difference when the page color is not white (or whatever background color the GIF was designed for).
Quote:
The only advantage I see in GIF is that it is supported by the old Mobipocket format, whereas PNG is not... but if you are converting from ePub to Mobipocket, the converter will convert from PNG to GIF too. |
|
![]() |
![]() |
![]() |
#10 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,613
Karma: 6718541
Join Date: Dec 2004
Location: Paradise (Key West, FL)
Device: Current:Surface Go & Kindle 3 - Retired: DellV8p, Clie UX50, ...
|
Quote:
One BIG CAUTION with PNG. It is an extremely plastic format that has many many variants and options, many of which are poorly supported by a large number of apps. It also supports custom ancillary data. This later ability can result in massive PNGs depending on the tool used to create them and the save/export method and options chosen. If you know your conversion tool's options and choose wisely, PNG can be an excellent option. It's not a magic format and the conversion tools won't automagically create the best flavor of PNG for your use. When using a tool like Adobe (nee Macromedia) Fireworks which uses PNG as its native format and using its "Save..." option yields a very poor PNG for use in ePubs or for direct web use. Always use and "Export ..." functions and choose the flavor of PNG (lossy compressed, lossless, 24bit RGB color, CMYK color, indexed color, ...) that is appropriate for the particular image and its use. |
|
![]() |
![]() |
![]() |
#11 |
temp. out of service
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,812
Karma: 24285242
Join Date: May 2010
Location: Duisburg (DE)
Device: PB 623
|
If you want maximally optimised PNGs, the 1st step would be to run them trough Ken Silverman's PNGOUT http://advsys.net/ken/utils.htm
Then recompress them using the newest DEFLATE implementation: Zopfli. Use advancepng available in this package: http://advancemame.sourceforge.net/comp-download.html choose maximal compression level to use the Zopfli algorithm and set the i parameter to 1000. SVGs can be recompressed with advzip using the same parameters because they are zipped XML containers. |
![]() |
![]() |
![]() |
#12 | |
ePub Maker
![]() Posts: 120
Karma: 16
Join Date: Dec 2009
Location: Mordor
Device: iPad,Kindle 3, Nook 2
|
Quote:
On small screen, table and image should be allowed to zoom and move like on iBooks. (Kindle 3 already implemented.) So that we need not use this lagging method of converting tables into images. Even table can not be rendered correctly, how can we think ePub can be accepted widely? Adobe, IDPF, you should do better! |
|
![]() |
![]() |
![]() |
#13 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,050
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
|
Quote:
That's lamentable, because ceators of ebooks put so much energy in formatting tables to achieve certain text features, but it's completely useless to me. Whenever possible, keep it flat! |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Glo Graphics, pictures and tables in Epub | Elfuente | Kobo Reader | 1 | 12-03-2012 06:40 PM |
Tables in ePub: CSS | virtual_ink | ePub | 5 | 02-23-2012 02:51 PM |
ePub to Mobi issues with tables | apastuszak | Conversion | 11 | 06-20-2011 09:19 PM |
Converting Word Doc with Tables to Epub? | dhume01 | ePub | 8 | 12-28-2010 08:02 PM |