# Module `rasterio` - Support for saving and loading rasters as graphics files

Support for saving and loading rasters as graphics files.

## Index

- Process `read.raster` - Load an image file as a raster, with the format determined automatically based on the extension
- Process `read.raster.png` - Load a PNG file as a raster
- Process `write.raster` - Write a raster to a file, with the format determined automatically based on the extension
- Process `write.raster.png` - Write a raster out as a PNG file
- Process `write.raster.ppm` - Write a raster out as a PPM file
- Process `write.rasters` - Write rasters to files

## Declarations

### `png.occ`:31Process `read.raster.png`

`PROC read.raster.png (VAL []BYTE filename, RESULT RASTER raster)`

Load a PNG file as a raster.

### `png.occ`:43Process `write.raster.png`

`PROC write.raster.png (VAL []BYTE filename, VAL [][]INT raster)`

Write a raster out as a PNG file.

### `ppmwrite.occ`:27Process `write.raster.ppm`

`PROC write.raster.ppm (VAL []BYTE filename, VAL [][]INT raster)`

Write a raster out as a PPM file.

### `rasterio.occ`:37Process `read.raster`

`PROC read.raster (VAL []BYTE filename, RESULT RASTER raster)`

Load an image file as a raster, with the format determined automatically based on the extension.

The following extensions are currently supported:

- `.png`

### `rasterio.occ`:55Process `write.raster`

`PROC write.raster (VAL []BYTE filename, VAL [][]INT raster)`

Write a raster to a file, with the format determined automatically based on the extension.

The following extensions are currently supported:

- `.png`
- `.ppm`

### `rasterio.occ`:79Process `write.rasters`

`PROC write.rasters (VAL []BYTE prefix, suffix, CHAN RASTER in?, out!)`

Write rasters to files.

As each raster passes through, it's written to a file named `prefix000000suffix`, with the number incrementing by one for each frame. The files can be in any format supported by `write.raster`.

You can convert the resulting files into a video using `mencoder` or a similar tool; see the mencoder manual for more details.