Bug 88394

Summary: Circular shading is pixelated
Product: poppler Reporter: dave lepore <dave.lepore>
Component: generalAssignee: poppler-bugs <poppler-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: obscurans
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: pixelated circular shading
pixelated circular shading
Implement cairo function shading

Description dave lepore 2015-01-14 09:50:57 UTC
Created attachment 112208 [details]
pixelated circular shading

When the attached pdf is opened with a poppler based viewer the circular shading is rendered in a pixelated fashion, while in other viewer it looks smooth.
Comment 1 dave lepore 2015-01-14 09:52:01 UTC
Created attachment 112209 [details]
pixelated circular shading
Comment 2 Adrian Johnson 2015-01-15 11:10:42 UTC
Created attachment 112285 [details] [review]
Implement cairo function shading

The pdf contains a function based shading. Gfx subdivides the shading then draws each cell with a solid color resulting in a pixelated appearance for both cairo and splash. This could be fixed by reducing the size of each cell to 1 pixel. However this could significantly increase rendering time as the function has to be evaluated for each pixel.

The better fix is to interpolate the colors in each cell instead of using solid fills. I've fixed this for the cairo backend by using cairo mesh gradients to interpolate the colors in each cell.

I should also point out that the conical gradient in this particular pdf could have been created with a type 6 shading (coons patch meshes). This would produce a better result and does not rely on evaluating a type 4 PostScript calculator function.
Comment 3 Carlos Garcia Campos 2015-12-04 10:57:42 UTC
Pushed, sorry for the delay reviewing this. Thanks!
Comment 4 Jason Crain 2015-12-25 04:40:54 UTC
*** Bug 70259 has been marked as a duplicate of this bug. ***

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.