VideoHelp Forum
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 45
Thread
  1. I have png files that are 96 dpi, with 48 bit (16 bit per channel), and have a resolution of 1920x1080. I want put them in a pdf file where I export them using 96 dpi to get the same resolution and bit as the input. How do I do that without losing any quality?
    Last edited by Mr. Fanservice; 28th Jan 2024 at 00:26.
    Quote Quote  
  2. Try Inkscape and/or Scribus - they may support high bitdepth images in PDF's.
    Quote Quote  
  3. Originally Posted by pandy View Post
    Try Inkscape and/or Scribus - they may support high bitdepth images in PDF's.
    If not, then what else?
    Quote Quote  
  4. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Png format is NOT directly supported in pdf - you must either convert to jpg or to an uncompressed (bmp/dib-type or tiff) image and applies lzw/zip or similar lossless compression on it. ALL apps do this, either explicitly or automatically behind the scenes.


    Scott
    Last edited by Cornucopia; 28th Jan 2024 at 13:07.
    Quote Quote  
  5. Originally Posted by Mr. Fanservice View Post
    If not, then what else?
    TBH no clue but perhaps this can be helpful https://blog.idrsolutions.com/understanding-the-pdf-file-format/#makeyourown

    PDF is able to support 16bit per component lossless images - question is what tool can perform such action.
    Quote Quote  
  6. Originally Posted by Cornucopia View Post
    Png format is NOT directly supported in pdf - you must either convert to jpg or to an uncompressed (bmp/dib-type or tiff) image and applies lzh/zip or similar lossless compression on it. ALL apps do this, either explicitly or automatically behind the scenes.


    Scott
    Well, how do I compress bmp or tiff files into pdf files without losing quality? Do they compress better than png, as well as lossless JPEG2000 files? Why aren't png directly supported?
    Quote Quote  
  7. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Because it isn't part of the pdf spec. You have got to remember, when the pdf spec was created in 1992, the only universally common shared image formats were jpg & tiff. And pdf spec was proprietary (Aldus/Adobe). It has expanded its capabilities through the years, and since 2008 is now an open standard, but the general use of it has been fixed for quite some time.

    However, you shouldn't have to worry about that, since as I said, it can still be stored uncompressed or losslessly compressed using a few different methods, so no loss anyway, as long as you are careful and explicit in your conversions. PNG --> BMP --> TIFF --> PDF --> PNG doesn't lose any quality, as long as you don't do something else like resize, change color model, subsampling, etc.

    Jpg2k is partially supported in pdf, but I am not sure about the lossless variety.

    As mentioned, it is often the particular tool that determines whether a variation is processed (and compressed) correctly or not. The gold standard is probably Adobe Acrobat, but even that doesn't cover everything.

    Also, it's still not clear why you need to convert them at all in order to view properly, or why you chose pdf?


    Scott
    Quote Quote  
  8. Originally Posted by Cornucopia View Post
    Because it isn't part of the pdf spec. You have got to remember, when the pdf spec was created in 1992, the only universally common shared image formats were jpg & tiff. And pdf spec was proprietary (Aldus/Adobe). It has expanded its capabilities through the years, and since 2008 is now an open standard, but the general use of it has been fixed for quite some time.

    However, you shouldn't have to worry about that, since as I said, it can still be stored uncompressed or losslessly compressed using a few different methods, so no loss anyway, as long as you are careful and explicit in your conversions. PNG --> BMP --> TIFF --> PDF --> PNG doesn't lose any quality, as long as you don't do something else like resize, change color model, subsampling, etc.

    Jpg2k is partially supported in pdf, but I am not sure about the lossless variety.

    As mentioned, it is often the particular tool that determines whether a variation is processed (and compressed) correctly or not. The gold standard is probably Adobe Acrobat, but even that doesn't cover everything.

    Also, it's still not clear why you need to convert them at all in order to view properly, or why you chose pdf?


    Scott
    I have a lot of png files that I want to compress to pdf files to save space while keeping their same properties. How do I do this with Acrobat or something like ImageMagick or Irfanview?
    Quote Quote  
  9. Originally Posted by Mr. Fanservice View Post
    I have a lot of png files that I want to compress to pdf files to save space while keeping their same properties. How do I do this with Acrobat or something like ImageMagick or Irfanview?
    Verify if your uncompressed PNG files can be compressed by 7z compressor more than maximum PNG compression - PDF will not help you to reduce PNG size. It may be worse than PNG.
    Quote Quote  
  10. Originally Posted by pandy View Post
    Originally Posted by Mr. Fanservice View Post
    I have a lot of png files that I want to compress to pdf files to save space while keeping their same properties. How do I do this with Acrobat or something like ImageMagick or Irfanview?
    Verify if your uncompressed PNG files can be compressed by 7z compressor more than maximum PNG compression - PDF will not help you to reduce PNG size. It may be worse than PNG.
    It can.
    Quote Quote  
  11. Originally Posted by Mr. Fanservice View Post
    It can.
    I assume your reply means that you can get smaller file size if you are compressing uncompressed PNG with ultra settings in 7z than size of file when maximum compression in PNG is used. Then stop pursuing rainbow unicorn and use 7z general compressor.
    Quote Quote  
  12. Originally Posted by pandy View Post
    Originally Posted by Mr. Fanservice View Post
    It can.
    I assume your reply means that you can get smaller file size if you are compressing uncompressed PNG with ultra settings in 7z than size of file when maximum compression in PNG is used. Then stop pursuing rainbow unicorn and use 7z general compressor.
    I mean my pdf files are smaller than 7z files with the ultra setting.
    Quote Quote  
  13. Originally Posted by Mr. Fanservice View Post
    I mean my pdf files are smaller than 7z files with the ultra setting.
    Question is - are you sure about used ultra settings - did they provide lossless quality?
    Quote Quote  
  14. Originally Posted by pandy View Post
    Originally Posted by Mr. Fanservice View Post
    I mean my pdf files are smaller than 7z files with the ultra setting.
    Question is - are you sure about used ultra settings - did they provide lossless quality?
    yes, for both
    Quote Quote  
  15. How much smaller were the PDF than the 7zip compressed files ?

    What did you use to make the PDF and to extract from the PDF ? Are you sure it didn't truncate to 8bit ?
    Quote Quote  
  16. Originally Posted by poisondeathray View Post
    How much smaller were the PDF than the 7zip compressed files ?

    What did you use to make the PDF and to extract from the PDF ? Are you sure it didn't truncate to 8bit ?
    pdf (398MB) vs 7z (1.09GB). Just need a tool to extract the png files as 48bit images. I used ImageMagick at 100 quality for png to pdf, by the way.
    Quote Quote  
  17. Originally Posted by Mr. Fanservice View Post
    Originally Posted by poisondeathray View Post
    How much smaller were the PDF than the 7zip compressed files ?

    What did you use to make the PDF and to extract from the PDF ? Are you sure it didn't truncate to 8bit ?
    pdf (398MB) vs 7z (1.09GB). Just need a tool to extract the png files as 48bit images. I used ImageMagick at 100 quality for png to pdf, by the way.

    That filesize difference is too large. 100 quality sounds like 8bit jpeg compression

    This is an old post, but one of the imagemagick authors wrote

    At this moment in time ImageMagick only supports writing 8-bit pdf files.
    https://stackoverflow.com/questions/43833703/create-pdf-from-16bit-image-using-imagemagick

    I can't find information that is more recent . But that filesize difference vs. 7z already tells you the PDF is not lossless .
    Quote Quote  
  18. Originally Posted by poisondeathray View Post
    Originally Posted by Mr. Fanservice View Post
    Originally Posted by poisondeathray View Post
    How much smaller were the PDF than the 7zip compressed files ?

    What did you use to make the PDF and to extract from the PDF ? Are you sure it didn't truncate to 8bit ?
    pdf (398MB) vs 7z (1.09GB). Just need a tool to extract the png files as 48bit images. I used ImageMagick at 100 quality for png to pdf, by the way.

    That filesize difference is too large. 100 quality sounds like 8bit jpeg compression

    This is an old post, but one of the imagemagick authors wrote

    At this moment in time ImageMagick only supports writing 8-bit pdf files.
    https://stackoverflow.com/questions/43833703/create-pdf-from-16bit-image-using-imagemagick

    I can't find information that is more recent . But that filesize difference vs. 7z already tells you the PDF is not lossless .
    What programs do compress 16bit images losslessly and/or write 16bit pdf files? I tried Acrobat, but I had to use 72dpi instead of 96dpi like my png files to get the right resolution. Or is there a way to fix that or some other program can do it?
    Quote Quote  
  19. Originally Posted by Mr. Fanservice View Post
    What programs do compress 16bit images losslessly and/or write 16bit pdf files? I tried Acrobat, but I had to use 72dpi instead of 96dpi like my png files to get the right resolution. Or is there a way to fix that or some other program can do it?

    For 16bit PDF, Photoshop can , but you have setup all the options correctly . It uses JPEG2000 for lossless compression . It uses a newer type of PDF standard that limits compatibility.

    You can get better 16bit compression with jpeg-xl by itself; PDF is not really meant for image storage
    Quote Quote  
  20. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Do a before vs after bitwise comparison (difference). It should tell you whether it is truly lossless or not.


    Scott
    Quote Quote  
  21. Originally Posted by Mr. Fanservice View Post
    Originally Posted by poisondeathray View Post
    How much smaller were the PDF than the 7zip compressed files ?

    What did you use to make the PDF and to extract from the PDF ? Are you sure it didn't truncate to 8bit ?
    pdf (398MB) vs 7z (1.09GB). Just need a tool to extract the png files as 48bit images. I used ImageMagick at 100 quality for png to pdf, by the way.
    Nope - perform this test:

    Save your source, 16 bit per component (48 bit ) twice:
    - as PNG with maximum compression
    - as PNG without compression

    Then compress each file with 7z in ultra settings.
    Compare file size and report results.

    PDF just adding uncertainty as way how bitmap is stored is unknown (or there is no clear control on process).
    Quote Quote  
  22. Originally Posted by poisondeathray View Post
    Originally Posted by Mr. Fanservice View Post
    What programs do compress 16bit images losslessly and/or write 16bit pdf files? I tried Acrobat, but I had to use 72dpi instead of 96dpi like my png files to get the right resolution. Or is there a way to fix that or some other program can do it?

    For 16bit PDF, Photoshop can , but you have setup all the options correctly . It uses JPEG2000 for lossless compression . It uses a newer type of PDF standard that limits compatibility.

    You can get better 16bit compression with jpeg-xl by itself; PDF is not really meant for image storage
    What about Adobe Acrobat?
    Quote Quote  
  23. Originally Posted by Mr. Fanservice View Post

    What about Adobe Acrobat?
    I couldn't find a way for 16bit lossless images for PDF in Acrobat
    Quote Quote  
  24. Actually 16bit not lossless in PS either . I was getting 99.5db PSNR in round trips -

    The reason is PS doesn't work in true 16bit ; it's actually 15+1 .

    For 16bit it works internally in 0 to 32,768 range , instead of 0 to 65,535

    https://community.adobe.com/t5/photoshop-ecosystem-discussions/16-bit-or-15-bit-1/m-p/3268264


    If true mathematically lossless 16bit is important to you , you can probably forget PDF, since Adobe is responsible for the PDF specs and they are the original author of the format
    Quote Quote  
  25. Originally Posted by poisondeathray View Post
    Actually 16bit not lossless in PS either . I was getting 99.5db PSNR in round trips -

    The reason is PS doesn't work in true 16bit ; it's actually 15+1 .

    For 16bit it works internally in 0 to 32,768 range , instead of 0 to 65,535

    https://community.adobe.com/t5/photoshop-ecosystem-discussions/16-bit-or-15-bit-1/m-p/3268264


    If true mathematically lossless 16bit is important to you , you can probably forget PDF, since Adobe is responsible for the PDF specs and they are the original author of the format
    So how do I get or make true 16bit pdf files, then?
    Last edited by Mr. Fanservice; 31st Jan 2024 at 07:28.
    Quote Quote  
  26. Originally Posted by Mr. Fanservice View Post
    So how do I get or make true 16bit pdf files, then?
    They are truly 16bit images in the PDF - but there is negligible quality loss in the intermediate processing. I don't know of any other way besides Adobe to make and extract the images in 16bit . Some tools are pure 8bit

    What is the background information and source of the images ? Do they have real 16bit data or interpolated 16bit ?
    Quote Quote  
  27. Originally Posted by poisondeathray View Post
    Originally Posted by Mr. Fanservice View Post
    So how do I get or make true 16bit pdf files, then?
    They are truly 16bit images in the PDF - but there is negligible quality loss in the intermediate processing. I don't know of any other way besides Adobe to make and extract the images in 16bit . Some tools are pure 8bit

    What is the background information and source of the images ? Do they have real 16bit data or interpolated 16bit ?
    They are 96dpi and 48bit.
    Quote Quote  
  28. Originally Posted by Mr. Fanservice View Post
    Originally Posted by poisondeathray View Post
    Originally Posted by Mr. Fanservice View Post
    So how do I get or make true 16bit pdf files, then?
    They are truly 16bit images in the PDF - but there is negligible quality loss in the intermediate processing. I don't know of any other way besides Adobe to make and extract the images in 16bit . Some tools are pure 8bit

    What is the background information and source of the images ? Do they have real 16bit data or interpolated 16bit ?
    They are 96dpi and 48bit.
    But where is the actual data from ? What is the source ? Is this a raw photo, some artwork etc... ? Where is it from ?
    Quote Quote  
  29. Originally Posted by Mr. Fanservice View Post
    They are 96dpi and 48bit.
    Nope - there is no natural 16 bit consumer sources - for consumer true 16 bit images can be but only synthetic - store them as RAW an use 7z or similar general compression algorithm. I will be glad to see true bitdepth of your source.
    Quote Quote  
  30. Originally Posted by pandy View Post
    Originally Posted by Mr. Fanservice View Post
    They are 96dpi and 48bit.
    Nope - there is no natural 16 bit consumer sources - for consumer true 16 bit images can be but only synthetic - store them as RAW an use 7z or similar general compression algorithm. I will be glad to see true bitdepth of your source.
    So there are no pdf files that can losslessly hold 48 (or 16) bit images and extract them while having the same quality? Do 48bit images have higher quality than 24bit ones?
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!