You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Anders Straadt <ak...@esoft.dk> on 2006/03/02 11:29:55 UTC

Bad anti-aliasing?

Here's an image.
http://test2.dmz.esoft.dk/extern/plantegn/eplan/test2.png

It's made out of tileable SVG files. The lines in the SVG files are defined with care - the widths are identical, and the lengths are known. Still there are two problems: there are holes between the SVG files (i marked them with red arrows), and the widths seem semi-aliased, e.g. look at the the lower line between the two upper corner SVG's - it seems thinner than those joining with it. When I scale the picture down even more, lines often disappear and reappear, just like if you downsized a bitmap picture with only nearest neighbour sampling.

It's integer-like aliasing, in a floating-point world (I'm quite sure that I'm not personally responsible for the lack of accuracy). I'm drawing the SVG files by calling paint on the root GraphicsNode. I'm doing transforms on the Graphics object (well, Graphics2D). I've enabled anti-aliasing in the Graphics object (as in, graphics.addRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON));), but the anti-aliasing isn't helping much.

I want the image to be seamless, and the anti-aliasing to work correctly. How do I solve this one? (The only "solution" I can think of, is drawing a gigantic image, and scaling it down with multisampling, but that's not acceptable).

-- 
Anders Straadt, Application Developer
aks@esoft.dk, http://www.esoft.dk/
esoft systems, Skibhusvej 52C, DK-5000 Odense C
Phone: +45 70 222 466, Fax: +45 63 122 466, Mobile: +45 25 559 111

- Got this email by mistake? Please visit http://www.esoft.dk/email/ for
details


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Bad anti-aliasing?

Posted by Cameron McCormack <ca...@mcc.id.au>.
Hi Anders.

Anders Straadt:
> It's made out of tileable SVG files. The lines in the SVG files
> are defined with care - the widths are identical, and the lengths
> are known. Still there are two problems: there are holes between
> the SVG files (i marked them with red arrows), and the widths seem
> semi-aliased, e.g. look at the the lower line between the two upper
> corner SVG's - it seems thinner than those joining with it. When I
> scale the picture down even more, lines often disappear and reappear,
> just like if you downsized a bitmap picture with only nearest
> neighbour sampling.

Try putting shape-rendering="geometricPrecision" on your root 'svg'
element.  That should solve the problem, I think.

Cameron

-- 
 Cameron McCormack			ICQ: 26955922
 cam (at) mcc.id.au			MSN: cam (at) mcc.id.au
 http://mcc.id.au/			JBR: heycam (at) jabber.org

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org