% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/render_bw.R
\name{render_bw}
\alias{render_bw}
\title{Render Black and White}
\usage{
render_bw(
  image,
  rgb_coef = c(0.2126, 0.7152, 0.0722),
  filename = NULL,
  preview = FALSE
)
}
\arguments{
\item{image}{3-layer RGB/4-layer RGBA array, \code{rayimg} class, or filename of an image.}

\item{rgb_coef}{Default \code{c(0.2126, 0.7152, 0.0722)}.
Length-3 numeric vector listing coefficients to convert RGB to luminance.}

\item{filename}{Default \code{NULL}. The filename of the image to be saved. If this is not given, the image will be plotted instead.}

\item{preview}{Default \code{FALSE}. Whether to plot the convolved image, or just to return the values.}
}
\value{
A \code{rayimg} RGBA array.
}
\description{
Transforms an image to black and white, preserving luminance.
}
\examples{
\dontshow{if (interactive() || identical(Sys.getenv("IN_PKGDOWN"), "true")) withAutoprint(\{ # examplesIf}
#Plot the image with a title
dragon |>
 render_title("Dragon", title_offset=c(10,10), title_bar_color="black",
           title_size=20, title_color = "white") |>
 render_bw(preview = TRUE)
\dontshow{\}) # examplesIf}
}
