Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to save a raster map in GRASS in jpeg/bmp format without using the GUI for d.out.file/ Is there a script to do it? I tried r.out.gdal but it produced a map that is black and white.

share|improve this question
What's the range of the map? If it has negative values, they cannot be represented in JPEG/BMP to my knowledge. – markusN Mar 25 '11 at 17:43
it is from -25 to 1000. I'll just fix the negative values and Try saving it again. I had generated a jpeg file from a raster map using r.out.gdal but it just produced a black and white map – teamAngat Mar 26 '11 at 3:52
If it is a floating point map, also that cannot be represented in JPEG or BMP format. What do you want to achieve with the export? – markusN Mar 26 '11 at 8:45
It is a floating point map and I am trying to save it in another image format rather than PNG since PNG cannot be embedded directly on the application that I am using. – teamAngat Mar 27 '11 at 20:22
E.g. GeoTIFF can stored floating point. – markusN Mar 28 '11 at 23:33

Have a look on d.out.file command. See that page and format option. BMP is available.

share|improve this answer

You can use the GDAL library by:

r.out.gdal InRaster.dem format=JPEG output=out.jpg

have a look at the documentation here.

share|improve this answer
Small note: From GRASS 6.4 onwards, the command name is r.out.gdal – markusN Mar 27 '11 at 18:24
Link only answers tend to become irrelevant with time. – Luís de Sousa 8 hours ago

If for some odd reason d.out.file doesn't work, you could also add the GRASS raster to a QGIS map and use the File > Save as Image command. Alternatively, add to QGIS and create a layout which you can export as an image.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.