NAME

r.in.png - Converts a PNG image file to a GRASS raster file.
(GRASS Raster Data Import Program)

SYNOPSIS

r.in.png [-hv] input=name output=name [title=string] [gamma=value] [alpha=value]

DESCRIPTION

This program converts a PNG raster file to a GRASS raster file.

OPTIONS

Flags:

-f
Create floating-point maps (range 0.0 - 1.0).
-h
Output image file header only; don't create map(s).
-v
Verbose mode.

Parameters:

input=name
Name of an existing PNG raster file to be imported.
output=name
Name to be assigned to resultant raster map layer(s).
title=string
Title to be assigned to resultant raster map layer(s).
gamma=value
Perform gamma correction using this value for the display gamma.
alpha=value
Pixels with an alpha (transparency) value less than or equal to this value are imported as no-data cells.

NOTES

The output depends upon the format of the PNG image. Gray-scale and paletted (indexed, color-mapped) images will result in a single output map, with the name specified by the output option.

True-color (RGB) images will result in three output maps, whose names are formed by appending ".r", ".g" and ".b" to the name specified by the output option.

For both gray-scale and true-color images, if transparency information is present, an additional map will be created whose name is formed by appending ".a" to the name specified by the output option.

For paletted images, the resulting cell values will be the color indices from the image, with the map's color table generated from the image's palette. For gray-scale and true-color images, the cell values will be the intensity values from the image. The map's color table will map these values to the normalized intensity levels, incorporating any gamma correction.

However, when the -f flag is used, any scaling or gamma correction is performed on the actual cell values. The map's color table will be a linear gray scale. Also, paletted images will first be expanded to true-color.

The user should adjust boundary coordinates stored in the cell header after import using r.support or r.region.

The gamma option is only used if the image contains a gamma specification.

The alpha option is only relevant if the image contains transparency information.

SEE ALSO

r.composite
r.support
r.region
parser

AUTHOR

Glynn Clements

Last changed: $Date$