Answers.Body: <p>The short answer is: PDF is not a good format for storing image data. The only reason that it is often used for doing so, is that it is one of the few formats (the other more well known ones are DjVu and TIFF), that allow you to store multiple (scanned) images in a single file. </p>
  
  <p>The longer answer is that the possible storage of image data in PDF files is done in a less efficient way than is possible in the way DjVu does. So in general, unless the DjVu file is compressed inefficiently to start with, you will <strong>always</strong> get a bigger PDF file, or you get a much worse quality image. </p>
  
  <p>The primary difference, apart from algorithms used for compression, is that an image in a DjVu file consists of multiple layers, each compressed separately, with optimized algorithms for the layer's data (monotone, color etc.), and recombined for display/printing. Especially on a page with characters (not selectable text associated with the characters) combined with images DjVu easily gets 20x smaller files at similar lossy quality. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-04T14:53:03.513Z
Answers.Text: Modern PDFs can make use of very good compression algorithms such as JPEG2000 (JPXDecode) and JBIG2--virtually equivalent to the compression used by DJVU, and they can also compress multiple layers of an image separately and overlay them, just like DJVU. My copiers at work do this when they scan documents to PDF files, and the resulting PDFs are very small. But I'm not familiar with many software packages that take advantage of these techniques.
Answers.UserDisplayName: willus
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-05-26T10:51:16.370Z
Answers.LastActivityDate: 2014-05-27T07:11:21.183Z
Answers.LastEditDate: 2014-05-27T07:11:21.183Z
Answers.UserDisplayName: Anthon
Answers.Body: <p>You can read about the <code>djvu</code> file format <a href="http://en.wikipedia.org/wiki/DjVu" rel="nofollow">here</a> (with focus on the compression <a href="http://en.wikipedia.org/wiki/DjVu#Compression" rel="nofollow">here</a>), but the main difference is how the two formats compress the data. </p>
  
  <p>Here are some relevant excerpts from Wikipedia:</p>
  
  <blockquote>
    <p>DjVu has been promoted as an alternative to PDF, promising smaller
    files than PDF for most scanned documents.[4] The main difference
    between DjVu and PDF is that DjVu is a pure raster file format while a
    PDF file can contain both vector and raster graphics.</p>
    
    <p>DjVu divides a single image into many different images, then
    compresses them separately. To create a DjVu file, the initial image
    is first separated into three images: a background image, a foreground
    image, and a mask image. The background and foreground images are
    typically lower-resolution color images (e.g., 100 dpi); the mask
    image is a high-resolution bilevel image (e.g., 300 dpi) and is
    typically where the text is stored. The background and foreground
    images are then compressed using a wavelet-based compression algorithm
    named IW44.[5] The mask image is compressed using a method called JB2
    (similar to JBIG2). The JB2 encoding method identifies nearly
    identical shapes on the page, such as multiple occurrences of a
    particular character in a given font, style, and size. It compresses
    the bitmap of each unique shape separately, and then encodes the
    locations where each shape appears on the page. Thus, instead of
    compressing a letter "e" in a given font multiple times, it compresses
    the letter "e" once (as a compressed bit image) and then records every
    place on the page it occurs.</p>
  </blockquote>
  
  <p>As for converting a djvu to a pdf without increasing the size, there is a program that claims it can do so called <a href="http://www.stdutility.com/stduconverter.html" rel="nofollow">Scientific and Technical Document Utility</a> (it is not free). I have never used it myself though.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-10-12T06:22:33.853Z
Answers.Text: The program says it's free now and I was able to use it without a problem.
Answers.UserDisplayName: GDP2
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-28T01:38:00.813Z
Answers.Text: The program works, but PDF size is increased. On my test from DjVu 12 Mb to PDF 40 Mb with default settings. (ver. 2.0.154)
Answers.UserDisplayName: sergtk
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-07-25T20:26:47.500Z
Answers.Text: It makes 300 k out of a 22 k 2 page bill. I saw an online converter do 100 k. So it's no use.
Answers.UserDisplayName: Robert
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-05-24T15:49:33.030Z
Answers.LastActivityDate: 2014-05-24T15:49:33.030Z
Answers.UserDisplayName: Jason Down
Body: <p>Why does converting a djvu file to pdf increase the size of the file? How can we convert a djvu to a pdf without increasing the size?</p>
  
Tags: <pdf><djvu>
Title: Conversion of djvu file into pdf file without increasing file size
UserDisplayName: Four Seasons
ThreadText: # Conversion of djvu file into pdf file without increasing file size
  
  (Asked by: username_0 on 2014-05-24)
  
  Why does converting a djvu file to pdf increase the size of the file? How can we convert a djvu to a pdf without increasing the size?
  
  **Tags:** pdf, djvu
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2014-05-26. Score: 8
  
  The short answer is: PDF is not a good format for storing image data. The only reason that it is often used for doing so, is that it is one of the few formats (the other more well known ones are DjVu and TIFF), that allow you to store multiple (scanned) images in a single file.
  
  The longer answer is that the possible storage of image data in PDF files is done in a less efficient way than is possible in the way DjVu does. So in general, unless the DjVu file is compressed inefficiently to start with, you will **always** get a bigger PDF file, or you get a much worse quality image.
  
  The primary difference, apart from algorithms used for compression, is that an image in a DjVu file consists of multiple layers, each compressed separately, with optimized algorithms for the layer's data (monotone, color etc.), and recombined for display/printing. Especially on a page with characters (not selectable text associated with the characters) combined with images DjVu easily gets 20x smaller files at similar lossy quality.
  
  > **Comments:**
  > **username_2**: Modern PDFs can make use of very good compression algorithms such as JPEG2000 (JPXDecode) and JBIG2--virtually equivalent to the compression used by DJVU, and they can also compress multiple layers of an image separately and overlay them, just like DJVU. My copiers at work do this when they scan documents to PDF files, and the resulting PDFs are very small. But I'm not familiar with many software packages that take advantage of these techniques.  
  
  ---
  
  ### Answer by username_3 on 2014-05-24. Score: 4
  
  You can read about the `djvu` file format [here](http://en.wikipedia.org/wiki/DjVu) (with focus on the compression [here](http://en.wikipedia.org/wiki/DjVu#Compression)), but the main difference is how the two formats compress the data.
  
  Here are some relevant excerpts from Wikipedia:
  
  > DjVu has been promoted as an alternative to PDF, promising smaller
  > files than PDF for most scanned documents.[4] The main difference
  > between DjVu and PDF is that DjVu is a pure raster file format while a
  > PDF file can contain both vector and raster graphics.
  >
  > DjVu divides a single image into many different images, then
  > compresses them separately. To create a DjVu file, the initial image
  > is first separated into three images: a background image, a foreground
  > image, and a mask image. The background and foreground images are
  > typically lower-resolution color images (e.g., 100 dpi); the mask
  > image is a high-resolution bilevel image (e.g., 300 dpi) and is
  > typically where the text is stored. The background and foreground
  > images are then compressed using a wavelet-based compression algorithm
  > named IW44.[5] The mask image is compressed using a method called JB2
  > (similar to JBIG2). The JB2 encoding method identifies nearly
  > identical shapes on the page, such as multiple occurrences of a
  > particular character in a given font, style, and size. It compresses
  > the bitmap of each unique shape separately, and then encodes the
  > locations where each shape appears on the page. Thus, instead of
  > compressing a letter "e" in a given font multiple times, it compresses
  > the letter "e" once (as a compressed bit image) and then records every
  > place on the page it occurs.
  
  As for converting a djvu to a pdf without increasing the size, there is a program that claims it can do so called [Scientific and Technical Document Utility](http://www.stdutility.com/stduconverter.html) (it is not free). I have never used it myself though.
  
  > **Comments:**
  > **username_4**: The program says it's free now and I was able to use it without a problem.  
  > **username_5**: The program works, but PDF size is increased. On my test from DjVu 12 Mb to PDF 40 Mb with default settings. (ver. 2.0.154)  
  > **username_6**: It makes 300 k out of a 22 k 2 page bill. I saw an online converter do 100 k. So it's no use.  
  
  ---
  
  