[GRASS-dev] Re: [GRASS GIS] #72: PNG driver: boundary rendering is off by one pixel

GRASS GIS trac at osgeo.org
Wed Dec 3 05:55:28 EST 2008


#72: PNG driver: boundary rendering is off by one pixel
--------------------------+-------------------------------------------------
  Reporter:  hamish       |       Owner:  grass-dev at lists.osgeo.org    
      Type:  defect       |      Status:  new                          
  Priority:  blocker      |   Milestone:  6.4.0                        
 Component:  default      |     Version:  svn-develbranch6             
Resolution:               |    Keywords:  d.vect, rendering, PNG_DRIVER
  Platform:  Unspecified  |         Cpu:  Unspecified                  
--------------------------+-------------------------------------------------
Comment (by hamish):

 Replying to [comment:11 glynn]:
 > Okay. There were two problems with the existing polygon filler,
 > which should be fixed by attachment:ticket:72:pngdriver-polygon.patch.
 ...
 > The one issue which this patch doesn't attempt to address is the
 > fact that all lines are effectively shifted half a pixel down and
 > to the right. This is inherent in the use of integer coordinates.

 any preprocessing floor(0.5+x) voodoo of the line data to align them with
 the polygon rendering? [yeah, that's what got us into this mess in the
 first place]

 > While you can draw a polygon with orthogonal edges perfectly
 > aligned to the pixel grid, you can't draw a single-pixel
 > orthogonal stroke with its centre-line so aligned.

 ... as it would have to be zero or two pixels wide.


 > I have attached PNG files containing the output before and after
 > the patch, as well as corresponding SVG files which show exactly
 > what is happening in more detail.

 I've attached a zoom of "after" showing the left over stray pixels
 shown in the SVG. Even with those, a nice improvement.


 thanks a lot for looking into this- to me this issue is a really bad look
 for us, sloppy output makes the project look sloppy. (and annoying for me
 to have to use xwd instead of d.out.file in 6.4.


 I'll try the patch in the AM.

 cheers,
 Hamish

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/72#comment:12>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list