[GRASSLIST:5811] PNG hardcopy scripts revisited

H Bowman hamish_nospam at yahoo.com
Thu Mar 20 07:22:53 EST 2003


As promised in [GRASSLIST:5808], here are two revised scripts to automate PNG hardcopy dumps.

The first uses GRASS's PNG driver with d.save, the second uses xwd to take a screen dump of the window. Both should run without user intervention, acting on the currently selected monitor.

d.out.png.driver:
+ more reliable for unattened use
- might not process d.text or d.mapgraph output
   (What d.redraw shows is what you get)
- will not output truecolor PNGs without the GD 2.0 library installed.
- requires xwininfo from the xbase-clients package (or so named in Debian)

d.out.png.xwdump:
+ Doesn't require libgd2, GD Graphics Library version 2, for truecolor
   output (takes bit-depth from x-windows display)
+ What you see is what you get
- not double buffered, so window must be on-top and on-screen.
- requires the ImageMagick tools and xbase-clients for xwd
- pnmtopng broke 3 days ago in Debian/testing, so I can't test it much right now.

The ImageMagick tools and xbase-clients will be installed on most setups already.

Hope someone finds them useful.



In producing these, I've noticed that I get slightly different output depending on which one I use. Particularly the PNG driver seems to be suffering a similar, yet different, bug as the d.area vs d.vect off-by-one translation bug.
Zooming way in on the PNGs shows that the vector layer is the same pixel by pixel in both, but the rasters are slightly different (not just datum off-by-one as far as I can tell and the following image suggests), but 'grown'. Not a big worry, but it degrades the quality of the PNG-driver output.

I can't give you a very good example as my pnmtopng is broken right now, but here's one I made a while back:
http://bambi.otago.ac.nz/hamish/bad_png_driver.png


peace,
Hamish

-------------- next part --------------
A non-text attachment was scrubbed...
Name: d.out.png.driver
Type: application/octet-stream
Size: 1048 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-user/attachments/20030321/b76dc196/d.out.png.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: d.out.png.xwdump
Type: application/octet-stream
Size: 507 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-user/attachments/20030321/b76dc196/d.out.png-0001.obj


More information about the grass-user mailing list