Discussion:
[gs-bugs] [Bug 698778] - Ghostscript - PDF to png transparent or gray lines through the document
b***@artifex.com
2017-11-24 14:51:13 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698778

Bug ID: 698778
Summary: PDF to png transparent or gray lines through the
document
Product: Ghostscript
Version: 9.22
Hardware: Macintosh
OS: MacOS X
Status: UNCONFIRMED
Severity: normal
Priority: P4
Component: Other Driver
Assignee: ghostpdl-***@artifex.com
Reporter: ***@gmail.com
QA Contact: gs-***@ghostscript.com
Word Size: ---

Created attachment 14489
--> http://bugs.ghostscript.com/attachment.cgi?id=14489&action=edit
transparent lines

The command

gs -o out.png -sDEVICE=pngalpha -r300 in.pdf

generate png with horizontal lines across the document

I tried different -r options from 100 up 500 and lines still here.
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-11-24 14:54:22 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698778

--- Comment #1 from George <***@gmail.com> ---
Created attachment 14490
--> http://bugs.ghostscript.com/attachment.cgi?id=14490&action=edit
Export from photoshop (white)

When i use "quick png export" in Adobe Photoshop for the same source PDF there
are no lines.
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-11-24 14:54:51 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698778

--- Comment #2 from George <***@gmail.com> ---
Created attachment 14491
--> http://bugs.ghostscript.com/attachment.cgi?id=14491&action=edit
GS export white
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-11-24 14:55:15 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698778

--- Comment #3 from Ken Sharp <***@artifex.com> ---
PNG files of the output aren't a huge amount of help, we're going to need the
original PDF file to investigate. At a guess this has already been fixed, but
we cna't tell without seeing the file.
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-11-24 14:56:20 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698778

--- Comment #4 from George <***@gmail.com> ---
Created attachment 14492
--> http://bugs.ghostscript.com/attachment.cgi?id=14492&action=edit
Source PDF white
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-11-24 14:57:49 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698778

--- Comment #5 from George <***@gmail.com> ---
(In reply to Ken Sharp from comment #3)
Post by b***@artifex.com
PNG files of the output aren't a huge amount of help, we're going to need
the original PDF file to investigate. At a guess this has already been
fixed, but we cna't tell without seeing the file.
Yes i knew that, it just take time to upload all files one by one
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-11-24 15:19:08 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698778

--- Comment #6 from Ken Sharp <***@artifex.com> ---
How have you created the 'transparent lines' PNG which is different from the
'GS export white' PNG ?

I cannot reproduce the output in the 'transparent lines' PNG currently, my
output looks identical to the GS export white, though with a transparent
background of course.
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-11-24 15:23:08 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698778

Robin Watts <***@artifex.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@artifex.com

--- Comment #7 from Robin Watts <***@artifex.com> ---
(In reply to George from comment #5)
Post by b***@artifex.com
Yes i knew that, it just take time to upload all files one by one
Sorry, you'd be amazed the number of people that expect us to discern the
problem from guesswork alone :)

We have fixed such problems in our latest development version.

Either you can grab a copy of the source from git.ghostscript.com yourself and
build a copy to try, or you can try a workaround.

Add -dSCANCONVERTERTYPE=1 to your command line (before the filename!) and see
if that solves your problem.
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-11-24 15:26:46 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698778

--- Comment #8 from George <***@gmail.com> ---
(In reply to Ken Sharp from comment #6)
Post by b***@artifex.com
How have you created the 'transparent lines' PNG which is different from the
'GS export white' PNG ?
I cannot reproduce the output in the 'transparent lines' PNG currently, my
output looks identical to the GS export white, though with a transparent
background of course.
I am sorry Ken, 'transparent lines' PNG is just an example with close look. It
created from different source pdf with inverted colors.
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-11-24 15:34:05 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698778

--- Comment #9 from Ken Sharp <***@artifex.com> ---
(In reply to George from comment #8)
Post by b***@artifex.com
(In reply to Ken Sharp from comment #6)
Post by b***@artifex.com
How have you created the 'transparent lines' PNG which is different from the
'GS export white' PNG ?
I cannot reproduce the output in the 'transparent lines' PNG currently, my
output looks identical to the GS export white, though with a transparent
background of course.
I am sorry Ken, 'transparent lines' PNG is just an example with close look.
It created from different source pdf with inverted colors.
OK well its helpful to have the same PDF file to run here when looking for
problems....

In fact I can see a thin transparent line in the 'white' output I get here,
which is not present when using the current code.

So as Robin said, you can try using the old scan converter, or download and
build the current code from our Git repository. Either should resolve your
problem.
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-11-24 15:41:16 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698778

--- Comment #10 from George <***@gmail.com> ---
(In reply to Robin Watts from comment #7)
... or you can try a workaround.
Add -dSCANCONVERTERTYPE=1 to your command line (before the filename!) and
see if that solves your problem.
Looks like workaround does not work for me.
To be honest i does not get which filename before i should place new option, so
i tried both:
gs -dSCANCONVERTERTYPE=1 -o out.png -sDEVICE=pngalpha -r500 in.pdf
gs -o out.png -sDEVICE=pngalpha -r500 -dSCANCONVERTERTYPE=1 in.pdf

And have same result with twice.
We have fixed such problems in our latest development version.
Either you can grab a copy of the source from git.ghostscript.com yourself
and build a copy to try,
Should i be some guru and know tricky whodo practices to build gs locally? I
downloaded last git snapshot and can not find readme or something.

Is it known date for upcoming gs update with last fixes?

And thank you and Ken for help.
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-11-24 15:45:28 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698778

--- Comment #11 from Ken Sharp <***@artifex.com> ---
(In reply to George from comment #10)
Post by b***@artifex.com
Looks like workaround does not work for me.
To be honest i does not get which filename before i should place new option,
gs -dSCANCONVERTERTYPE=1 -o out.png -sDEVICE=pngalpha -r500 in.pdf
gs -o out.png -sDEVICE=pngalpha -r500 -dSCANCONVERTERTYPE=1 in.pdf
Anywhere before the input filename is fine.
Post by b***@artifex.com
And have same result with twice.
Hmm, in that case can you post the 'inverted colour' PDF file please ?

While I do see a line with the old code, I only see one, which is not what your
file showed.
Post by b***@artifex.com
Is it known date for upcoming gs update with last fixes?
Ghostscript is released twice per year, in March and September (approximately).
We won't release a version until it passes our testing so occasionally we slip
by a week or two. Nevertheless, the next release is scheduled for March 2018.
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-11-24 16:00:59 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698778

--- Comment #12 from Ken Sharp <***@artifex.com> ---
I checked the 9.22 release with -dSCANCONVERTERTYPE=1 and indeed the
transparent line I can see (behind the S in Back Squat) is not solved, so its
not the scan converter.

On the other hand, release and debug builds of the current code don't show the
problem for me at all. I'm trying a bisect now but I may run out of time today.
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-11-24 17:01:41 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698778

--- Comment #13 from Ken Sharp <***@artifex.com> ---
For me the commit which fixed this was:

http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=684f73e8deefacb2aa5d2277f3154b68809b2ab7

--------------------------------------------------------------------
Bug 698672: Fix new scanconverter/alphabits interaction.

The alphabits mechanism relies on the scan converter not
writing trapezoids so tall as to cause its line buffers
to flush too early.

This is achieved by honoring the max_band_height field in
the device header. Previously the new scan converter was
ignoring this. Here we alter the code to pay attention to
it.
--------------------------------------------------------------------

Which is at least related to the scan converter, as expected.....

It looks like we told you the wrong value for SCANCONVERTERTYPE, if I try the
9.22 release with SCANCONVERTERTYPE=0 then I get the expected result.
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-11-25 07:13:46 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698778

--- Comment #14 from George <***@gmail.com> ---
(In reply to Ken Sharp from comment #13)
Post by b***@artifex.com
It looks like we told you the wrong value for SCANCONVERTERTYPE, if I try
the 9.22 release with SCANCONVERTERTYPE=0 then I get the expected result.
It works!
Finally SCANCONVERTERTYPE=0 produce output without horizontal lines! Thank you
very much.
It looks like you can close this report.
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-11-25 09:24:52 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698778

Ken Sharp <***@artifex.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |WORKSFORME

--- Comment #15 from Ken Sharp <***@artifex.com> ---
Thanks for confirming, the next release will of course have the correct fix so
the work-around won't be required.
--
You are receiving this mail because:
You are the QA Contact for the bug.
Loading...