Bug 300604

Summary: Rendering artifacts even after antialiasing disabled
Product: [Applications] okular Reporter: Manuel López-Ibáñez <lopezibanez>
Component: PDF backendAssignee: Okular developers <okular-devel>
Status: RESOLVED NOT A BUG    
Severity: normal CC: aacid
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: screenshort: left Adobe Reader, right Okular, both with antialising disabled.
PDF testcase
Screenshot of disable graphicsantialias

Description Manuel López-Ibáñez 2012-05-25 13:30:29 UTC
It is well-known that PDF viewers have problems rendering pdf's produced by R. R developers blame PDF viewers and recommend to disable Antialiasing: http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-are-there-unwanted-borders

However, even after disabling antialiasing. there are rendering artifacts in Okular that are not present in Adobe Reader. See the attached PNG screen capture. The PDF used is also attached.

Reproducible: Always
Comment 1 Manuel López-Ibáñez 2012-05-25 13:31:20 UTC
Created attachment 71358 [details]
screenshort: left Adobe Reader, right Okular, both with antialising disabled.
Comment 2 Manuel López-Ibáñez 2012-05-25 13:32:44 UTC
Created attachment 71359 [details]
PDF testcase
Comment 3 Albert Astals Cid 2012-06-30 14:59:46 UTC
How did you disable antialias?
Comment 4 Manuel López-Ibáñez 2012-06-30 20:47:04 UTC
I followed the instructions given by the R project itself:

http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-are-there-unwanted-borders

Okular (Linux/KDE)
    There is not an option in the GUI to enable/disable anti-aliasing. From a console command line, use:

              $ kwriteconfig --file okularpartrc --group 'Dlg Performance' \
                             --key TextAntialias Disabled

    Then restart Okular. Change the final word to ‘Enabled’ to restore the original setting. 

(I wouldn't be surprised if the info is outdated.)
Comment 5 Albert Astals Cid 2012-07-01 07:37:43 UTC
Why would you disable text antialias and then complain that there is antialiasing in the graphics?

If you want to disable graphics antialiasing you need to use GraphicsAntialias in that command line instead of TextAntialias

It'd also be cool if you could fix R FAQ

I'm closing this bug because it's basically not right.
Comment 6 Manuel López-Ibáñez 2012-07-01 14:50:40 UTC
Right, that makes sense, but still:

$ kwriteconfig --file okularpartrc --group 'Dlg Performance' --key GraphicsAntialias Disabled

does not seem to have any effect on the test.pdf. It gives exactly the same output shown in the screenshot attached.

Nonetheless, I will try to get the R FAQ fixed.  Thanks for looking at this.

I guess the underlying issue producing the artifacts must be really hard to solve, since not even Adobe Reader gets it 100% right. As a PDF expert, if you have any intuition about what could R do better to reduce the artifacts, I would appreciate your advice.
Comment 7 Albert Astals Cid 2012-07-01 15:07:06 UTC
Created attachment 72259 [details]
Screenshot of disable graphicsantialias

It works for me, make sure you did exactly type this
kwriteconfig --file okularpartrc --group 'Dlg Performance' --key GraphicsAntialias Disabled
Comment 8 Manuel López-Ibáñez 2012-07-16 14:35:59 UTC
OK. I upgraded Okular and the output is exactly as you said! Great! Thanks very much. 
BTW, the R FAQ is fixed.