-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Ghost Lines" when using Anti-aliasing, polygons with shared boundaries, and no outline/QT::NoPen #12023
Comments
Author Name: Paolo Cavallini (@pcav) Is this a QGIS, or a Qt bug? |
Author Name: springmeyer - (springmeyer -) 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. |
Author Name: Paolo Cavallini (@pcav) Is this still true for current Qt and QGIS versions? Please confirm. |
Author Name: John Tull (John Tull) This problem still exists in trunk with the most recent Qt release. |
Author Name: Tim Sutton (Tim Sutton) Hi I did a little test using both:
In src/gui/qgsmapcanvasmap.cpp for [[AntiAlias]] flags. Both choices did not resolve the issue for me. Using:
|
Author Name: springmeyer - (springmeyer -) 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/) |
Author Name: Tim Sutton (Tim Sutton) 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.
|
Author Name: springmeyer - (springmeyer -) Okay. |
Author Name: Henrik Uggla (@huggla) Turning off "Make lines appear less jagged..." removes the thin lines on the screen but they still show when printing (see attached pdf). I can find no option for disabling anti-aliasing in the composer. Applies to both Windows7 and ubuntugis. Note regarding attached pdf: The thin lines are displayed differently in different pdf-viewers.
|
Author Name: Jürgen Fischer (@jef-n)
|
Author Name: Johannes Kroeger (Johannes Kroeger) I realised that #16269 and #18620 were duplicates of this and closed them accordingly. Has anything happened in the past years or maybe, hopefully, in QT5 that allows this to be fixed? It would highly improve cartographic quality in some use cases. If not, a "use fill color for stroke" checkbox would be nice, if that indeed is a workaround for this (as suggested in the duplicates). It could be a useful addition for other use cases as well maybe? |
Author Name: Giovanni Manghi (@gioman)
|
Author Name: Johannes Kroeger (Johannes Kroeger) A workaround to this is: Set the Stroke width to Hairline I forgot who shared this, either Nathan or Nyall. :) |
Author Name: Giovanni Manghi (@gioman) Johannes Kroeger wrote:
is this in the docs? Can't find it.
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. 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. |
Author Name: Johannes Kroeger (Johannes Kroeger) I don't think so, it was either on IRC or Twitter. This issue remains, please keep it opened. The workaround is just that, a workaround! |
I just realised this issue had been closed back then but it still exists and is still a major rendering issue. Please re-open, I think it was only closed by accident. |
@kannes but it should still be an upstream issue in QT, as far as I understand. |
Once/if upstream fixes this, it might require some changes in QGIS I think or maybe a workaround can be found to fix the issue in another way. Having it open with that tag seems like a good setup to me, thank you! Maybe even that silly workaround could be integrated (cue Clippy asking "It seems like you want to disable outlines for polygons, this will lead to visible boundaries between neighboring polygons due to a bug in Qt, would like to enable a workaround?") as a little fix. |
Glad I found this ticket, thank you for keeping it open for knowledge. Still present in latest |
When NoPen option is selected and Anti-Aliasing is enabled, polygons that share a boundary are bleeding out on each other, leading to an unwanted artifact. In that situation we prefer to draw a very thin line with the same color than the brush.
When NoPen option is selected and Anti-Aliasing is enabled, polygons that share a boundary are bleeding out on each other, leading to an unwanted artifact. In that situation we prefer to draw a very thin line with the same color than the brush.
Author Name: springmeyer - (springmeyer -)
Original Redmine Issue: 1963
Affected QGIS version: master
Redmine category:map_canvas
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.
The text was updated successfully, but these errors were encountered: