Bug 687742 - antialiasing can cause spurious lines at joined edges
Summary: antialiasing can cause spurious lines at joined edges
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Documentation (show other bugs)
Version: 8.13
Hardware: PC Linux
: P2 normal
Assignee: Ralph Giles
URL:
Keywords:
: 687789 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-10-08 07:47 UTC by arnaud01
Modified: 2008-12-19 08:31 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description arnaud01 2004-10-08 07:47:29 UTC
Using: gs -q -dBATCH -dNOPAUSE -dSAFER -r72 -dEPSCrop -sDEVICE=png16m
-dGraphicsAlphaBits=4 -sOutputFile=bb.png bb.ps
spurious lines are rendered.

Below is a test case:


%!PS-Adobe-1.0 EPSF-1.2
%%BoundingBox: 77 110 668 581      
%%Pages: 1   
%%PageOrder: Ascend
%%PaperSize: A4
%%PageOrientation: Landscape
%%DocumentFonts: 
%%EndComments

%%BeginProlog
/bdef {bind def} bind def
/c {setrgbcolor} bdef
/w {setlinewidth} bdef
/P {% Lay out a polygon
    % usage: x_n y_n x_n-1 y_n-1 ... x_0 y_0 n P
    3 1 roll moveto {rlineto} repeat} bdef
/F {P fill newpath} bdef %Fill a polygon

%Define line widths
/w0 {1 w} bdef

%Define colors:
/c5 {0 0.78 0.78 c} bdef
/c14 {0.42 0 0.86 c} bdef

%%EndProlog

%%BeginSetup
1 setlinecap 1 setlinejoin
%%EndSetup
%%Page: 1 1
71 109 translate %move origin slightly in
0.113400 0.113400 scale  % Units: 1000 = 2 cm
w0
% c14 blue c5 green
% bottom
c5 -2436 0 0 -350 2436 0 0 350 1124 1716 4 F
% top
c14 -3774 0  0 -350 3774 0 0 350 463 2066 4 F
c5 -2436 0 0 -350 2436 0 0 350 1124 2066 4 F
showpage
%%Trailer
%%EOF
Comment 1 Alex Cherepanov 2004-10-08 19:27:19 UTC
I confirm that this problem exists in all versions tested from 6.61
to the current CVS. The problem appears to be related to anti-aliasing
logic.
Comment 2 Jack Moffitt 2004-10-24 21:24:42 UTC
This is what happens when you antialias on a tight gap.  The background can
bleed through.
Comment 3 arnaud01 2004-10-25 02:43:16 UTC
Please add a note in the documentation. I took me a while to trace the problem
to antialising.
Comment 4 Jack Moffitt 2004-10-25 07:38:44 UTC
This problem should probably be documented in Issues.htm or somewhere else
appropriate in the documentation.
Comment 5 Ralph Giles 2004-10-25 09:16:02 UTC
Issues isn't really a good place for this I think, since it's not really a bug.
I'll add a note next to GraphicsAlphaBits.
Comment 6 arnaud01 2004-10-25 09:29:31 UTC
Note that ImageMagick uses ghostscript as postscript generator
and set by default -dGraphicsAlphaBits=4 in a fairly well
hidden config file which is not user modifiable (that is without
root access).

From http://www.cs.wisc.edu/~ghost/doc/cvs/Use.htm#Rendering_parameters,
<quote>
-dTextAlphaBits=n
-dGraphicsAlphaBits=n
    These options control the use of subsample antialiasing. Their use is highly
recommended for producing high quality rasterizations. The subsampling box size
n should be 4 for optimum output, but smaller values can be used for faster
rendering. Antialiasing is enabled separately for text and graphics content.
Allowed values are 1, 2 or 4.
</quote>

Please mention that -dGraphicsAlphaBits=n may produce undesirable results
and may not consequently be "highly recommended".

Regards,
Comment 7 Ralph Giles 2004-11-01 01:17:44 UTC
It's still highly recommended, it's just that one occasionally encounters files
that depend on a particular rendering behavior.

In any case, I've added a warning to the documentation.
Comment 8 Alex Cherepanov 2005-07-27 12:56:20 UTC
*** Bug 687789 has been marked as a duplicate of this bug. ***