-1

When you look at the rendered version of the SVG https://commons.wikimedia.org/wiki/File:Triangle-perpendicular.svg, it has jagged lines:

enter image description here

For example, the line AC doesn't look as it should look. How can I convert this image to a PNG without getting jagged lines?

What I've tried

inkscape +antialias -background none -z -e test.png -w 276 Triangle-perpendicular.svg

This seems not to have any effect.

Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
  • you need to use anti-aliasing, which just "hides" the jaggies. it's impossible to prevent it. – Marc B Nov 10 '15 at 15:22
  • @MarcB I know that I cannot prevent this effect in general, but I thought it would be possible to make it less obvious. I've tried the anti-aliasing option of `convert` it seems not to have an effect. So are you saying there is no way to not see the jagging in lines which have this angle with my current screen resolution? – Martin Thoma Nov 10 '15 at 15:32
  • depends on how many colors you have available as well. if that's a 256 color png, then you likely don't have enough color slots to handle all the necessary shades of grey necessary to represent the anti-aliased pixels. – Marc B Nov 10 '15 at 15:33

1 Answers1

0

I've been looking at the original source svg, and it doesn't render terribly well in the browser either. AFAICT, you are rendering with antialiasing, but the stroke width and angle of your triangle are conspiring to look awkward. Try increasing the stroke width a little, or (if you can), change the angle of the line. Both might help.

The original stroke width is .79..., try 1.0

Dav3xor
  • 386
  • 2
  • 6