I convert a PDF file to a PNG file. The PNG file has a white line in the middle. Command line under WindowsXP: ...\gs8.62\bin\gswin32c.exe -dQUIET -dNOPAUSE -dBATCH -sstdout=%stderr - dFirstPage=1 -dLastPage=1 -sDEVICE=pngalpha -dTextAlphaBits=4 - dGraphicsAlphaBits=4 -dDOINTERPOLATE -r111x111 - sOutputFile=6jahre_2sp_4c_r111x111_p1.png 6jahre_2sp_4c.pdf The effect is dependent on the resolution. But the version 8.61 converts the image properly. The same effect under Linux.
Created attachment 4226 [details] 6jahre_2sp_4c.pdf Source File
Created attachment 4227 [details] 6jahre_2sp_4c_r111x111_p1.png My example PNG
I'll leave it to Alex to decide for sure, but this looks like its caused by multiple images abutted. There are actually 6 images in the file (all 139 by 121), which are butted together top, bottom, left and/or right. All the images are anamorphically scaled (by the same amount): 33.361 0 0 28.812 And they are placed at non-integer locations. When the location, scaling, resolution and rounding errors happen to hit certain values the images don't quite butt up together leaving a small gap, probably the scaled height of the image does not quite match the scaled location of the next image. The 'white line' is a pretty good match by eye for the end of the upper images. I'm pretty sure I've seen this reported elsewhere. Experimentation with zoom values in Acrobat can often reproduce this, though you have to turn off 'smooth images' first.
I have seen that in the PDF 6 images are positioned side by side. And I suspect that the error comes through. Unfortunately, I get PDF files from an advertising agency and can not affect its production. The PNG resolution depends on the size of the target document and is dynamic.
Important parameters are -dDOINTERPOLATE and -r . Other parameters can be omitted or changed. Interpolated picture has the stripe at 73, 91, 96, 101, 111, 196 dpi, but has no stripe at any other integer resolution below 500 dpi. Non-interpolated picture has no stripe at any integer resolution below 500 dpi. Fixing this bug should be relatively easy by comparing image positions and sizes in the interpolated and non-interpolated cases.
Its still my personal opinion that this is an expected problem with files constructed in this way, but given that it only (allegedly) is a problem with interpolation I'm going to pass it to Robin to take a look. IMO we should use the tiffscaled approach for any anti-aliased output and deprecate TextAlphaBits and GraphicsAlphaBits.
The problem still occurs with the 9.27 release candidate. The simplest command line that gives the problem is: gs -sDEVICE=ppmraw -o test.ppm -r111 -dDOINTERPOLATE 6jahre_2sp_4c.pdf
The problem is reproduced in the current master branch.