% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/maxent_outputs.R
\name{maxent_write_prediction_png}
\alias{maxent_write_prediction_png}
\title{Write a Maxent Prediction Grid as a PNG Image}
\usage{
maxent_write_prediction_png(
  grid,
  filename,
  presence_rows = NULL,
  presence_cols = NULL,
  test_rows = NULL,
  test_cols = NULL,
  mode = "plain",
  legend = TRUE,
  width = 800L,
  height = 600L
)
}
\arguments{
\item{grid}{External pointer to a GridFloat prediction grid (e.g.
from \code{\link{maxent_project_cloglog}}).}

\item{filename}{Character: path for the output PNG file.}

\item{presence_rows}{Integer vector of presence row indices (0-based) or
\code{NULL} (default).}

\item{presence_cols}{Integer vector of presence column indices (0-based) or
\code{NULL} (default).}

\item{test_rows}{Integer vector of test-set row indices (0-based) or
\code{NULL} (default).}

\item{test_cols}{Integer vector of test-set column indices (0-based) or
\code{NULL} (default).}

\item{mode}{Colour mode passed to \code{\link{maxent_color_ramp}}:
one of \code{"plain"} (default), \code{"log"}, \code{"blackandwhite"},
or \code{"redandyellow"}.}

\item{legend}{Logical: draw a colour-bar legend (default \code{TRUE}).}

\item{width}{Integer: PNG width in pixels (default 800).}

\item{height}{Integer: PNG height in pixels (default 600).}
}
\value{
Invisibly returns \code{filename}.
}
\description{
Converts a \code{GridFloat} prediction grid to a colour PNG image using
the canonical Maxent colour ramp (red = high, blue = low).  Optionally
overlays presence and test-point locations, and renders a small legend.
}
\examples{
\donttest{
pred <- maxent_project_cloglog(model, list(g1, g2), c("bio1", "bio12"))
maxent_write_prediction_png(pred, tempfile(fileext = ".png"))
}
}
