7 ms·
DjVu, an open PDF alternative
- adamnemecek 8y agoThe interesting thing is Yann LeCun’s involvement.
- pronoiac 8y agoI'd avoid using this. This is a format that's lossy re: text, so text and numbers can get silently rewritten; it reuses a letter image, placing it throughout a page wherever it's recognized. A low resolution scan or bad ocr results in silently corrupted text.
- exikyut 8y agoDo you have any sources for this? This is very interesting. Particularly because Xerox photocopiers (yes, self-contained photocopiers) had exactly the same kinds of issues due to image compression engine glitches (https://news.ycombinator.com/item?id=6156238 https://news.ycombinator.com/item?id=6156238, https://news.ycombinator.com/item?id=9584172 https://news.ycombinator.com/item?id=9584172)
- azdle 8y agoIt's not sourced, but the Wikipedia page says it uses something called JB2 compression which is susceptible to this: https://en.wikipedia.org/wiki/DjVu#Compression https://en.wikipedia.org/wiki/DjVu#Compression
- bb88 8y agoJBIG2 was the problem algorithm with the photocopiers. JBIG2 was based upon JB2.
- jacquesm 8y agoI've been reading quite a few DjVu encoded documents and have yet to see a single occurrence of what you describe. If there are such errors they will be visually indistinguishable from the original, and a good OCR package would likely identify the right letter given the context. Do you have some concrete examples of corrupted texts? I'd very much like them to use as test cases in a document processing pipeline.
- reaperducer 8y agohave yet to see a single occurrence of what you describe How would you know? Maybe if a document had an unusual misspelling. But how would you know if DjVu munged a 3 into an 8?
- LeoPanthera 8y agoBut this is an entirely hypothetical weakness. Without at least one example of it happening in the wild, it may as well not exist.
- monista 8y agoLet me assure you, this does exist in the wild. I spotted it many times, especially in documents scanned 15+ years ago, when space and bandwidth were an issue and people did anything to reduce file size, at the cost of quality. It was rare enough to not make the format unusable, but not just once, making you worry "was it 3 sp. or 8 sp.?" It seems also that the problem happens more often with cyrillic glyphs which have less descending/accending elements that typical latin ones.
- jacquesm 8y agoWith DjVu or with ocr'd documents in general?
- monista 8y agoWhile of course it's an issue with any scanned docs, the DjVu compression method makes it harsher, as, say, you can end with _all_ '8's in document replaced with '3' (or, say, 'h's with 'n's), at the same time keeping seemingly decent appearance so that you don't suspect that something is wrong.
- jacquesm 8y agoI'd love to see some concrete examples. I totally understand how this could theoretically happen but it all hinges on it actually happening in the documents that I'm working with and to have a test case where it happens for sure would make all the difference in determining whether or not the documents I'm working with are at risk or not and if so if I can detect which ones are at risk (that would be half the battle won). It would have to be a case where a human would see a 3 or an 8 (or a similar transposition with other glyphs) resulting in a document that is corrupted in such a way that afterwards the human would see the (invalid) alternative. Even a single instance of this happening would be very relevant.
- magic_quotes 8y agoCJB2 from DjVuLibre has lossless mode and it's enabled by default.
- coldseattle 8y agoThis may be an acceptable format for some electronic versions of scanned books, but it's not a "PDF Alternative". Also PDF is an open format.
- chungy 8y agoPDF wasn't an open format when DjVu was first created. Now that it is, there's probably no reason to use DjVu.
- ummonk 8y agoPDF is great for electronically created documents. DjVu is far superior for scanned documents, though. It compresses much smaller and DjVu viewers are far more performant at scrolling through large scanned documents.
- Hello71 8y agoeven compared to MuPDF? PDF.js is well known to be very slow, and even poppler is pretty slow compared to MuPDF.
- zokier 8y agoI still prefer Adobe Acrobat Reader despite everything, and absolutely hate PDF.js because it seems to take like few seconds to render a page when jumping around, whereas Adobe Acrobat Reader is pretty much interactive. Nevermind the fact that pdf.js has still problems rendering quite many documents I encounter, while Acrobat is basically the de-facto reference implementation for PDFs. btw if you want quickly some random large scanned PDFs for testing, archive.org is a goldmine. For example here is a scanned 1200 electronics handbook: https://archive.org/details/NationalSemiconductorLinearApplicationsHandbook1994 https://archive.org/details/NationalSemiconductorLinearAppli... They also do DjVu, so you can see the size difference there. For that particular book, its 58M for the PDF vs 31M for DjVu. So basically half the size.
- pmoriarty 8y ago
- futurix 8y agoWhat’s the point of this in 2018 - now that PDF is an open ISO standard?
- zeth___ 8y agoIt is much better optimized for scanned documents than PDF.
- xelxebar 8y agoDjvu are often a lot smaller in size than the corresponding PDF. I have a lot of math texts in electronic form and the difference is pretty dramatic.
- mindslight 8y agoFrom my own playing around figuring how I wanted to archive scanned documents, it's both smaller and much quicker to load. But going out on a limb with a format doesn't instill confidence for long term. It's great there's one "perfect" implementation that seems to just work, but perceived lack of an ecosystem is still worrying. Not that looking through the source of say libjpeg instills confidence either! I was also considering JP2 for nicer-looking artifacts, but couldn't bring myself to go that route. I eventually just increased my size budget (because disappearing a ream into 5GB is still damn useful!), and decided to just store lossless FLIF at 300dpi. I statically compiled the flif binary, do a test decode to make sure the bits round trip, and store checksums of the decoder binary and raw raster alongside. I then stuff this into a zip container (aka .cbz), along with some really poor jpg thumbnails so present evince can view it. I still need to write the transcoder to .djvu - when I'm no longer buried under piles of paper!
- gwern 8y agoI've been scanning a lot of books and switched over a while ago - you get books which can be 10x smaller, and which load and display faster too. And if you desperately need a PDF for some reason, they can be converted back easily.
- mnl 8y agoI've been using it for years. For scanned materials it's simply better: files are smaller, rendering is snappy, and if you're into old books its background/foreground model really pays off. Quite strange this scepticism here about good old djvu. Better fetch a book from the Internet Archive in both formats and check for yourselves why it's a thing.
- tombert 8y agoI feel like DjVu was never sufficiently better than PDF for me to bother using it. There are PDF readers for almost literally anything device imaginable, and often they are included with your choice of operating system. I feel like if DjVu would have more of an audience if it weren't for the fact that PDF is an open standard now.
- fiddlerwoaroof 8y ago10 years ago, my main computer was a pentium iii I had cobbled together from parts at a thrift store. Djvu was the only format for high resolution scans that would load without rendering the computer unusable.
- transfire 8y agoDjVu rocks. It's been around a long time too. It's a shame it hasn't been picked up more.
- kineticfocus 8y ago"...divides a single image into many different images, then compresses them separately." Wouldn't it be better to go the other way and backpack-algo the pages into a consolidated texture atlas based on edge similarity, and then run compression on the result?
- dunham 8y agoFrom what I understand, it segments the image into text and a background image, does something like JBIG2 on the text (building a global dictionary of glyphs and placing them on the page), and does a lossy compression on the background image. There aren't a lot of viewers out there for DjVu and the encoding side is patent encumbered, so I'm not interested in the format. You can get pretty close with JBIG2+Jpeg2k in a PDF file, I believe archive.org does this, but I don't know of an open source encoder that does it and sometimes PDF viewers don't decode jbig2/jpg2k efficiently.
- kccqzy 8y agoPeople like to say using DjVu gives you a 10x space saving over PDF for scanned documents. That's not exactly true. If you are comparing djvu to your scanner's default PDF output then yeah maybe the PDF is 10x bigger. But I've scanned enough documents to know how to properly optimize and tune the resulting PDFs. Things like JBIG2 are a huge improvement over default scanner output for text. And the result PDF is no more than 2x the djvu file. The portability gain is well worth it.
- agumonkey 8y agoany tool to batch tune/compress ? for a friend
- pmoriarty 8y agoThere's another gain for DJVU here: the speed gain. For scanned documents, my DJVU viewer lets me page much faster through a DJVU document than a PDF viewer does through a PDF. At least that's been my experience on my old, slow laptop, where speed really matters. Also, I don't always scan myself. Sometimes I'll get a PDF generated by someone else, which contains scanned images. Then I'll often convert it to DJVU for speed and space savings.
- Synaesthesia 8y agoI find it depends on the PDF and also on the software. On Mac OS PDFs are very fast.
- userbinator 8y agoThings like JBIG2 are a huge improvement over default scanner output for text. Just be careful that it doesn't silently change the text, because JBIG2 compressors can be lossy that way: https://news.ycombinator.com/item?id=6156238 https://news.ycombinator.com/item?id=6156238
- deleted 8y ago[deleted]
- MaxBarraclough 8y ago
- shmerl 8y agoUnfortunately some library sites still rely on DjVu plugin, and with Firefox dropping support for native plugins, those materials became inaccessible. Especially because single download is dynamic and generated by the plugin itself from multiple smaller files. Other than that, DjVu is a great format. For those who wonder how it's better than PDF for scanned texts - DjVu uses different compression for background and actual text, thus saving tons of space.
- mariuolo 8y agoWhat about the DjVu.js extension? But worst case scenario you could run something like Pale Moon or WaterFox only for accessing such documents. Also I know how slow institutional entities can be to adapt, but they will catch up eventually.
- shmerl 8y agoI haven't tried DjVu.js - I'll take a look, thanks!
- nkhodyunya 8y agoOn my MacBook Air 2013 I still have to convert scanned pdf to djvu in order to read it; otherwise the rendering with poppler is too slow.
- tacomonstrous 8y agoBack when I was graduate student, I developed a massive library of DjVu scans. Now, I find myself using Cloud Convert or djvu2pdf to make PDFs out of them on a slow on-going basis. Hardly anybody has DjVu readers on their machines now, especially with the advent of mobile. Actually, now that I think about it, the slide started all the way back in 2010 when I couldn't find a decent DjVu viewer for the iPad.
- noja 8y agoNo comments here addressing why PDF is still so slow at rendering?
- rantanplan 8y agoAre you sure the problem is not Acrobat Reader? I haven't used it for more than 10 years but I remember it being slow. Okular(provided by KDE), for example, is blazingly fast. Or at least, I haven't noticed any slowness.
- colejohnson66 8y agoI use SumatraPDF. It’s a lightweight PDF viewer and it loads really fast. Especially compared to Adobe.
- ttoinou 8y agoHow many software with the pun about déjà vu ? DJV View http://djv.sourceforge.net/ http://djv.sourceforge.net/ WinDjView https://windjview.sourceforge.io/ https://windjview.sourceforge.io/
- se7entime 8y agono one mentioning EPUB? https://en.wikipedia.org/wiki/EPUB https://en.wikipedia.org/wiki/EPUB
- unicornporn 8y agoThat's a very different beast. Not page aware.
- chmike 8y agoThat is also exactly it's strengh. Though epub3 now also allow to enforce paged content intended for comic books.
- Mikhail_Edoshin 8y agoIt's not a strength if you need that old book that has no electronic version and can only be scanned. AFAIK EPUB 3 allows for SVG layouts that can be, I imagine, very sophisticated; still, it doesn't address the old book case.
- deleted 8y ago[deleted]
- godelmachine 8y agoSadly there are not good enough DjVu readers. I use iOS 11.4
- Synaesthesia 8y agoYeah. I use Kybook on iOS.
- godelmachine 8y agoI too use the same, but I found it on AppStore after searching really hard. Most of them were asking to pay.
- valeg 8y agoBrowsers should support DjVu natively. It may help with wider adoption of the format.