Bug 697069 - PDF display inconsistency (gradient)
Summary: PDF display inconsistency (gradient)
Status: RESOLVED WONTFIX
Alias: None
Product: MuPDF
Classification: Unclassified
Component: mupdf (show other bugs)
Version: 1.7
Hardware: PC All
: P4 normal
Assignee: muPDF bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-26 04:13 UTC by Tomasz Kuchta
Modified: 2016-10-10 12:34 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
test file (2.58 MB, application/pdf)
2016-08-26 04:13 UTC, Tomasz Kuchta
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz Kuchta 2016-08-26 04:13:23 UTC
Created attachment 12890 [details]
test file

File 047838.pdf seems to be displayed inconsistently in MuPDF. The background has many while horizontal lines going across. That's not the case for Acrobat and Chromium.

The file comes from the Govdocs data set (http://digitalcorpora.org/corpora/govdocs)
It can be extracted from this archive: http://digitalcorpora.org/corp/files/govdocs1/zipfiles/047.zip
Comment 1 Robin Watts 2016-10-10 08:25:00 UTC
It's to do with the construction of the file, and the antialiasing method used by MuPDF.

The gradient is not rendered as a linear fill in PDF, but rather as a series of abutting lines.

These lines do not completely fill destination pixels, and so the background color blends through while anti-aliasing. This leads to the effect you see.

The only way around this is to disable anti-aliasing. This can be done at the command line with mutool draw, and as a compile option (-DAA_BITS=0) for the viewer.
Comment 2 Tomasz Kuchta 2016-10-10 08:42:48 UTC
Hi Robin, 
Thank you for checking that. 
If I understand correctly, the display difference is caused by the way the lies are drawn with anti-aliasing on - is that correct?
Is it the case that the rendering in Acrobat and Chromium is incorrect or we just can't say which one is correct as it is up to the PDF renderer to decide how to display that part?

Thank you,
Tomasz
Comment 3 Robin Watts 2016-10-10 12:34:10 UTC
(In reply to Tomasz Kuchta from comment #2)
> If I understand correctly, the display difference is caused by the way the
> lies are drawn with anti-aliasing on - is that correct?

Yes.

> Is it the case that the rendering in Acrobat and Chromium is incorrect or we
> just can't say which one is correct as it is up to the PDF renderer to
> decide how to display that part?

That's broadly correct.

When rendering without anti-aliasing, it's fairly clear what results are expected, and MuPDF/Acrobat/Chrome all pretty much agree.

When anti-aliasing is enabled the situation is fuzzier. There are approaches to AA that we could take (draw at a higher resolution and then scale down) where these results would not occur.

It is fairest to say that these results are due to a combination of the particular way that we choose to implement AA, with the construction of that PDF file.