After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 319049 - Suboptimal ghostscript antialiasing flags
Suboptimal ghostscript antialiasing flags
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
0.4.x
Other All
: Normal minor
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-10-17 08:54 UTC by Alexander E. Patrakov
Modified: 2005-12-30 19:55 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12


Attachments
Testcase (87.37 KB, application/postscript)
2005-10-17 08:58 UTC, Alexander E. Patrakov
Details
Screenshot of Evince (103.29 KB, image/png)
2005-10-17 08:59 UTC, Alexander E. Patrakov
Details
GGV renders the image fine (151.09 KB, image/png)
2005-10-17 09:02 UTC, Alexander E. Patrakov
Details

Description Alexander E. Patrakov 2005-10-17 08:54:23 UTC
Currently, evince passes the following flags to Ghostscript for antialiasing:    
"-sDEVICE=x11alpha -dNOPLATFONTS". With these flags, Ghostscript does not    
antialias PostScript files that are in fact just 1-bit bitmaps with huge    
resolution. 
 
Suggestion: use "-sDEVICE=x11alpha -dNOPLATFONTS -dTextAlphaBits=4    
-dGraphicsAplhaBits=4 -dDOINTERPOLATE" by default. Or make such flags  
configurable at runtime (for those who can't afford a CPU fast enough to handle 
-dDOINTERPOLATE smoothly). 

Other information:
GGV allows one to configure Ghostscript flags at runtime, Evince doesn't.
Comment 1 Alexander E. Patrakov 2005-10-17 08:58:18 UTC
Created attachment 53575 [details]
Testcase

This PostScript file is just a 1-bit 300-dpi bitmap in disguise. View it in GGV
and in Evince.
Comment 2 Alexander E. Patrakov 2005-10-17 08:59:37 UTC
Created attachment 53576 [details]
Screenshot of Evince

Evince doesn't antialias the image by default and cannot be configured to do
so.
Comment 3 Alexander E. Patrakov 2005-10-17 09:02:00 UTC
Created attachment 53577 [details]
GGV renders the image fine

GGV displays the image correctly once I go to Ghostscript configuration doalog
and add -dDOINTERPOLATE -dTextAlphaBits=4 -dGraphicsAlphaBits=4.

Relevant flag: -dDOINTERPOLATE

Evince should provide the same quality by default.
Comment 4 Nickolay V. Shmyrev 2005-12-29 17:48:14 UTC
Well, first of all I understand that selection of good options is a problem. But I am not sure what flags should we choose actually. 

Btw, can you measure the performance-loss caused by this change?
Comment 5 Alexander E. Patrakov 2005-12-30 04:09:32 UTC
On my computer, I told gs to render the test file to png16m:

time gs -sDEVICE=png16m -sOutputFile=junk%d.png -dNOPLATFONTS -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -dBATCH -dSAFER -dNOPAUSE -dDOINTERPOLATE wp0w+.ps

Results:

With -dDOINTERPOLATE: 1.387s
Without -dDOINTERPOLATE: 0.713s
Without -dDOINTERPOLATE and alpha bits: 0.690s
Comment 6 Alexander E. Patrakov 2005-12-30 05:26:24 UTC
Such slowdown is only relevant to huge bitmaps. On the standard tiger, I get:

With -dDOINTERPOLATE: 0.669s
Without -dDOINTERPOLATE: 0.673s
Without -dDOINTERPOLATE and alpha bits: 0.515s
Comment 7 Nickolay V. Shmyrev 2005-12-30 19:55:22 UTC
My results are even better, I have something like

1.0
0.95
0.92

It would be acceptable to make antialiasing options better. Moreover, one
can change those options in configure. So this bug should be fixed.