r.out.ppm.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <h2>DESCRIPTION</h2>
  2. <em>r.out.ppm</em> converts a GRASS raster map into a PPM image
  3. at the pixel resolution of the CURRENTLY DEFINED REGION.
  4. To get the resolution and region settings of the raster map, run:<p>
  5. <div class="code"><pre>
  6. g.region -p rast=[mapname]
  7. </pre></div>
  8. <p>
  9. before running <em>r.out.ppm</em>.<p>
  10. By default the PPM file created is 24-bit color, rawbits storage.
  11. You can use the <b>-g</b> flag to force <em>r.out.ppm</em> to
  12. output an 8-bit greyscale instead.
  13. The greyscale conversion uses the NTSC conversion:<p>
  14. <div class="code"><pre>
  15. Y = .30*Red + .59*Green + .11*Blue
  16. </pre></div>
  17. <p>One pixel is written for each cell value, so if <tt>ew_res</tt> and
  18. <tt>ns_res</tt> differ, the aspect ratio of the resulting image will be off.
  19. <h2>NOTES</h2>
  20. A few ppm file comments are written: the name of the GRASS
  21. raster map, resolution, etc. Although these are perfectly legal,
  22. I've found one PD image utility that chokes on them, so if you need
  23. a commentless PPM file, use '<tt>out=-&nbsp;&gt;&nbsp;outfile.ppm</tt>'. (When sending
  24. output to stdout, no comments are written.)
  25. <h2>HINTS</h2>
  26. You can create a PNG image with NULL values represented by a transparent
  27. background by using the <a href="pngdriver.html">PNG driver</a> with
  28. <a href="variables.html">GRASS_TRANSPARENT</a> set to TRUE.
  29. Alternatively, you can use the <em>pnmtopng</em> program from
  30. <a href="http://netpbm.sourceforge.net">netpbm</a> to do this:
  31. <div class="code"><pre>
  32. r.out.ppm raster
  33. pnmtopng -transparent white raster.ppm > raster.png
  34. </pre></div>
  35. <h2>SEE ALSO</h2>
  36. <em><a href="d.out.png.html">d.out.png</a></em><br>
  37. <em><a href="r.out.ascii.html">r.out.ascii</a></em><br>
  38. <em><a href="r.out.mpeg.html">r.out.mpeg</a></em><br>
  39. <em><a href="r.out.png.html">r.out.png</a></em><br>
  40. <em><a href="r.out.ppm3.html">r.out.ppm3</a></em><br>
  41. <em><a href="r.out.tiff.html">r.out.tiff</a></em>
  42. <h2>AUTHOR</h2>
  43. Bill Brown, UIUC
  44. <p><i>Last changed: $Date$</i>