r.out.png(1grass)

✨ r.out.png ✨

okay bestie, gather round, because r.out.png from the GRASS User's Manual is literally about to export a GRASS raster map as a non-georeferenced PNG image and it's giving ✨ icon ✨. no cap.

🏷️ NAME

r.out.png β€” Export a GRASS raster map as a non-georeferenced PNG image. πŸ’…

πŸ”‘ KEYWORDS

raster, export, output, PNG


πŸ“œ SYNOPSIS

r.out.png
r.out.png --help
r.out.png [-tw] input=name output=name  [compression=integer]
[--overwrite]  [--help]  [--verbose]  [--quiet]  [--ui]

🚩 Flags

  • -t β€” Make NULL cells transparent. bestie, this one is so fun
  • -w β€” Output world file πŸ‘‘
  • --overwrite β€” Allow output files to overwrite existing files
  • --help β€” Print usage summary
  • --verbose β€” Verbose module output
  • --quiet β€” Quiet module output
  • --ui β€” Force launching GUI dialog

πŸŽ€ Parameters

  • input=name [required] β€” Name of input raster map
  • output=name [required] β€” Name for new PNG file (use '-' for stdout)
  • compression=integer β€” Compression level of PNG file
    • (0 = none, 1 = fastest, 9 = best)
    • Options: 0-9
    • Default: 6

πŸ’– DESCRIPTION

so r.out.png exports a GRASS raster map in non-georeferenced Portable Network Graphics (PNG) image format, and the way it does that is by respecting the current region resolution and bounds. literally. that's the whole vibe.

Optionally, the user can choose to export a World File (.wld) to provide basic georeferencing support β€” yes, bestie, a whole georeferencing moment 🫢. And when you pair that with the transparency flag, you can create images that are useful for KML, TMS, or WMS overlays. (e.g. for use in Google Earth or as OpenLayers tiles) 🌈 iconic, honestly.

oh and heads up: if output is redirected to stdout, the world file will be called png_map.wld. not me remembering that for you πŸ₯°


🌸 EXAMPLE

The example is based on the North Carolina sample data. (classic, we love her)

Export of the soil map to PNG format with world file:

g.region raster=soils_Kfactor -p
# export PNG file with additional world file
r.out.png input=soils_Kfactor output=soils_Kfactor -w
# verify
gdalinfo soils_Kfactor.png

slay. it literally exported and verified itself. 😭


πŸ”— SEE ALSO

r.out.gdal, r.out.ppm, r.out.ascii, r.import


πŸ‘― AUTHORS

  • Alex Shevlakov
  • Hamish Bowman

πŸ“¦ SOURCE CODE

Available at: r.out.png source code (history)

Latest change: Tuesday May 20 11:33:36 2025 in commit: 8efb37cb1f4948e3e157a34b72071bacc35ec8df

Main index | Raster index | Topics index | Keywords index | Graphical index | Full index

Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual

okay that's the whole page, no notes πŸ’œ this was GRASS 8.5.0, r.out.png(1grass), and yes the copyright belongs to the GRASS Development Team from 2003 all the way to 2026. periodt. πŸ¦‹βœ¨

πŸ“¦ where this page comes from