Opened 15 years ago

Closed 13 years ago

Last modified 13 years ago

#1963 closed bug (wontfix)

"Ghost Lines" when using Anti-aliasing, polygons with shared boundaries, and no outline/QT::NoPen

Reported by: springmeyer Owned by: nobody
Priority: major: does not work as expected Milestone: Version 1.7.0
Component: MapCanvas Version: Trunk
Keywords: anti-aliasing, nopen, shared, polygons, 2x Cc: jctull, timlinux
Must Fix for Release: No Platform: All
Platform Version: Awaiting user input: no

Description

QT's anti-aliasing output exhibits an inherent limitation of AA, where polygon edges are drawn/feathered twice and the background color "bleeds" through what are supposed to be tightly shared edges of polygons.

I wonder if some of the new render hints in QT4.4 > might help work around this issue:

http://doc.trolltech.com/4.5/qpainter.html#RenderHint-enum

See also: http://trac.mapnik.org/ticket/428, where I am working on a workaround using AGG that may apply to the QT renderer, given an exposed API.

Attachments (1)

antialiasing_artifacts_with_nopen.png (54.0 KB ) - added by springmeyer 15 years ago.
Example of rendering glitch were seamless (no lines) are expected between polygons with shared boundaries

Download all attachments as: .zip

Change History (10)

by springmeyer, 15 years ago

Example of rendering glitch were seamless (no lines) are expected between polygons with shared boundaries

comment:1 by pcav, 14 years ago

Milestone: Version 1.4.0

Is this a QGIS, or a Qt bug?

comment:2 by springmeyer, 14 years ago

QT limitation which may benefit from workarounds in QGIS. I think this is an important ticket to have open for other users to see, or potentially as an FAQ only if we don't find an easy solution.

comment:3 by pcav, 14 years ago

Milestone: Version 1.5.0Version 1.6.0

Is this still true for current Qt and QGIS versions? Please confirm.

comment:4 by jctull, 14 years ago

This problem still exists in trunk with the most recent Qt release.

comment:5 by timlinux, 13 years ago

Hi

I did a little test using both:

QPainter::SmoothPixmapTransform
QPainter::HighQualityAntialiasing

In src/gui/qgsmapcanvasmap.cpp for AntiAlias flags. Both choices did not resolve the issue for me. Using:

QGIS r15734 Trunk
Qt 4.7

comment:6 by timlinux, 13 years ago

Cc: timlinux added

comment:7 by springmeyer, 13 years ago

We solved this sufficiently in Mapnik within the AGG renderer by allowing the user to control the AA gamma. A gamma of 0 is aliased while 1 is fully anti-aliased and setting gamma to around .6-.7 is able to remove the faint lines while keeping an AA-ish look with much more definition to edges (like coastlines) than can be achieved by the only other known workaround: overpainting with a thin line of the same color as the polygon fill. In short, we solved this by reducing the aggressiveness of the AA algorithm so that polygons are slightly dilated rather are fully AA or aliased.

So, I assume that QT will expose somewhere an equivalent gamma setting (or partial AA ability) - as QT's renderer is originally based on AGG (http://labs.qt.nokia.com/2009/12/18/qt-graphics-and-performance-the-raster-engine/)

comment:8 by timlinux, 13 years ago

Resolution: wontfix
Status: newclosed

Reading the the referenced article it seems they only were inspired by AGG and didnt directly use any source code from AGG in their implementation. It seems like Qt4 rendering engine does not expose any agg-like gamma options and there isnt really any reasonable work around we can come up with for this. I am going to close this ticket since the only way to resolve this issue currently is to disable AA rendering it would seem and there isnt anything else we can do to fix it.

comment:9 by springmeyer, 13 years ago

Okay.

Note: See TracTickets for help on using tickets.