r.out.ppm.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 raster=[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:
  14. <p>
  15. <div class="code"><pre>
  16. Y = .30*Red + .59*Green + .11*Blue
  17. </pre></div>
  18. <p>One pixel is written for each cell value, so if <tt>ew_res</tt> and
  19. <tt>ns_res</tt> differ, the aspect ratio of the resulting image will be off.
  20. <h2>NOTES</h2>
  21. A few ppm file comments are written: the name of the GRASS
  22. raster map, resolution, etc. Although these are perfectly legal,
  23. I've found one PD image utility that chokes on them, so if you need
  24. a commentless PPM file, use '<tt>out=-&nbsp;&gt;&nbsp;outfile.ppm</tt>'. (When sending
  25. output to stdout, no comments are written.)
  26. <h2>HINTS</h2>
  27. You can create a PNG image with NULL values represented by a transparent
  28. background by using the <a href="pngdriver.html">PNG driver</a> with
  29. <a href="variables.html">GRASS_RENDER_TRANSPARENT</a> set to TRUE.
  30. Alternatively, you can use the <em>pnmtopng</em> program from
  31. <a href="http://netpbm.sourceforge.net">netpbm</a> to do this:
  32. <div class="code"><pre>
  33. r.out.ppm raster
  34. pnmtopng -transparent white raster.ppm > raster.png
  35. </pre></div>
  36. <h2>SEE ALSO</h2>
  37. <em>
  38. <a href="d.out.file.html">d.out.file</a>,
  39. <a href="r.out.ascii.html">r.out.ascii</a>,
  40. <a href="r.out.gdal.html">r.out.gdal</a>,
  41. <a href="r.out.mpeg.html">r.out.mpeg</a>,
  42. <a href="r.out.png.html">r.out.png</a>,
  43. <a href="r.out.ppm3.html">r.out.ppm3</a>
  44. </em>
  45. <h2>AUTHOR</h2>
  46. Bill Brown, UIUC
  47. <p><i>Last changed: $Date$</i>