Page 2 of 2

Re: Upgrade pdf version! Is it possible?

Posted: Mon Oct 02, 2017 6:14 pm
by cday
XnTriq wrote:I believe that both of the following settings have to be activated to achieve similar/identical display of nc_lomonosov.pdf and adobe_lomonosov.pdf:
Acrobat User Guide (Viewing PDFs and viewing preferences → [url=]Rendering[/url]) wrote:
  • Smooth Line Art: Applies smoothing to remove abrupt angles in lines.
  • Smooth Images: Applies smoothing to minimize abrupt changes in images.

My copy of Acrobat already had those settings enabled, and image quality is *not* as good as when the original image is viewed in an image viewer...

I think the inference is that enhancement of the original PNG image, which is already very high quality, using a filter won't in itself improve the PDF image quality... :(

Possibly the paletted colour is being lost even when Adobe Acrobat (XI) is used to create the PDF, and quite possibly PDF files of images in general are not rendered to the standard possible in image viewers with 'high quality zoom' enabled??

Re: Upgrade pdf version! Is it possible?

Posted: Mon Oct 02, 2017 7:33 pm
by cday
Here is the original PNG opened in XnView Classic, converted to 64 Gray scale, and saved as a PDF with ZIP compression...

Note that the quality opened in Adobe Acrobat looks better, and the file size is still only 64KB (60.08KiB), much smaller than the other PDF versions posted.

Can someone compare the quality with the earlier PDF versions?

It should be possible to obtain the same result using NConvert with the same operations.

[Edit: I see NConvert also supports Indexed colours, which might possibly be a better option.]
(60.08 KiB) Downloaded 43 times

Re: Upgrade pdf version! Is it possible?

Posted: Mon Oct 02, 2017 9:30 pm
by XnTriq
I've updated my previous post and attached the losslessly extracted images for analysis.
Unfortunately I can't do any tests with Acrobat Reader because I'm using PDF-XChange Viewer.

BTW: As previously mentioned by our friend Peter2, “‘image extraction’ from PDF is not a conversion from PDF to Image. It uses only the images in the PDF - if there are some ...”
-oX- ([url=]PDF Extraction of Images[/url]) wrote:that the reason i have test dozens of pfd-extraction-tools and i have found only PDF-Tools give me 1:1 extraction
Michael Rutter ([url=]JPEG converters compared[/url]) wrote:JPEGs can be losslessly extracted from EPS and PDF documents by using psimages or pdfimages as appropriate. Two JPEGs are considered identical if their files are identical (maybe after processing with jpegtran -copy none -optimise to remove extra comments etc.). They are considered different if their quantisation tables differ. These are printed to stderr by djpeg -verbose -verbose img.jpg > /dev/null

Re: Upgrade pdf version! Is it possible?

Posted: Tue Oct 03, 2017 1:00 am
by XnTriq
As it turns out, PDF/PostScript documents can have an “interpolate flag”:
[color=green]pdfimages.exe -list *lomonosov.pdf[/color] wrote:

Code: Select all

                                     | page | num | type  | width | height | color | comp | bpc | enc   | interp | object | ID | x-ppi | y-ppi |    size | ratio
                 adobe_lomonosov.pdf |    1 |   0 | image |   726 |   1115 | rgb   |    3 |   8 | jpeg  | yes    |      6 |  0 |    96 |    96 | 274'315 | 11.0%
                    nc_lomonosov.pdf |    1 |   0 | image |   726 |   1115 | index |    1 |   8 | image | no     |      9 |  0 |    72 |    72 | 310'731 | 38.0%
xn_classic_64_gray_zip_lomonosov.pdf |    1 |   0 | image |   726 |   1115 | gray  |    1 |   8 | image | no     |      9 |  0 |    72 |    72 |  61'523 |  7.4%
SysTutorials (Man Pages → [url=]pdfimages[/url] → interp) wrote:"yes" if the interpolation is to be performed when scaling up the image
Stack Overflow ([url=]How to remove anti-aliasing in PDF images?[/url]) wrote:There is /Interpolate true entry in image dictionary of OCR-ed version, and that's what causes 'anti-aliasing'. Whether that (and not JPEG2000 instead of JPEG compression) is a cause of slow-down, you check on large enough files.

To un-set this key, the best would be to turn it off while creating a file, and if that's not possible, to write and run a small program in suitable language.
[color=green]adobe_lomonosov.pdf[/color] wrote:<</Subtype/Image/BitsPerComponent 8/Width 726/Interpolate true/ColorSpace/DeviceRGB/Height 1115/Filter[/DCTDecode]/Type/XObject/Length 273470>>
pdfimages.exe -j adobe_lomonosov.pdf adobe_lomonosov
pdfimages.exe -j nc_lomonosov.pdf nc_lomonosov
(97.88 KiB) Downloaded 36 times
pdfimages.exe -j xn_classic_64_gray_zip_lomonosov.pdf xn_classic_64_gray_zip_lomonosov
(60.19 KiB) Downloaded 34 times