% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/nr-core.R
\name{nr_new}
\alias{nr_new}
\alias{nr_new_from}
\title{Create a native raster image}
\usage{
nr_new(width, height, fill = "white")

nr_new_from(nr, fill = "white")
}
\arguments{
\item{width, height}{Image dimensions in pixels}

\item{fill}{Background fill color as a character string. Either a standard R color
(e.g. 'blue', 'white')
or a hex color of the form \code{#rrggbbaa}, \code{#rrggbb}, \code{#rgba}
or \code{#rgb}}

\item{nr}{native raster image to use as the template for the size of the 
new image in \code{nr_new_from()}}
}
\value{
native raster image
}
\description{
A native raster image in R looks like an integer matrix, but is interpreted
differently by graphics devices:
}
\details{
\itemize{
  \item{The data should be treated as RGBA pixels in row-major ordering}
  \item{Each 32-bit integer should be interpreted as 4-bytes - one for each
        of the R, G, B and A color channels}
}
}
\examples{
nr <- nr_new(400, 300, 'hotpink')
plot(nr)

}
\seealso{
Other image creation functions: 
\code{\link{nr_copy}()}
}
\concept{image creation functions}
