Bug 702074 - Bad rendering of a gradient
Summary: Bad rendering of a gradient
Status: UNCONFIRMED
Alias: None
Product: MuPDF
Classification: Unclassified
Component: mupdf (show other bugs)
Version: master
Hardware: PC Windows 10
: P4 normal
Assignee: MuPDF bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-01 01:48 UTC by Krzysztof Kowalczyk
Modified: 2025-10-15 09:19 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
Repro file (380.10 KB, application/pdf)
2020-02-01 01:48 UTC, Krzysztof Kowalczyk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Krzysztof Kowalczyk 2020-02-01 01:48:55 UTC
Created attachment 18827 [details]
Repro file

Reported in https://github.com/sumatrapdfreader/sumatrapdf/issues/913

The blue gradient at the top (behind LANL) is more "bandy" than rendered by e.g. Chrome (i.e. Foxit).
Comment 1 Krzysztof Kowalczyk 2020-02-01 02:02:05 UTC
Another file that likely has the same root cause is in https://github.com/sumatrapdfreader/sumatrapdf/issues/912
Comment 2 Tor Andersson 2025-10-15 09:19:02 UTC
The white stripes are caused by anti-aliased rendering drawing multiple thin rectangular paths. Each rectangle has semi-transparent edges that let the white background show through due to anti-aliasing; and when these are drawn in sequence these white "gaps" appear.

If you render without anti-aliasing the gradient is rendered fully solid.

This is an unfortunate side-effect of implementing anti-aliasing using coverage-based opacity instead of using multi-sampling (rendering at a higher resolution and down-sampling the final result).

The only "solutions" to this problem is disabling anti-aliasing either locally (by grid-fitting rectangle fills so they land perfectly on the pixel grid) or globally.