\Header{png}{JPEG and PNG graphics devices}
\alias{jpeg}{png}
\keyword{device}{png}
\begin{Description}\relax
A graphics device for JPEG or PNG format bitmap files.\end{Description}
\begin{Usage}
\begin{verbatim}
jpeg(filename = "Rplot.jpg", width = 480, height = 480, pointsize = 12,
     quality = 75, ...)
png(filename ="Rplot.png", width = 480, height = 480, pointsize = 12, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{filename}] the name of the output file.
\item[\code{width}] the width of the device in pixels.
\item[\code{height}] the height of the device in pixels.
\item[\code{pointsize}] the default pointsize of plotted text.
\item[\code{quality}] the `quality' of the JPEG image, as a
percentage. Smaller values will give more compression but also more
degradation of the image.
\item[\code{dots}] additional arguments to the \code{\Link{X11}} device.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Plots in PNG and JPEG format can easily be converted to many other
bitmap formats, and both can be displayed in most modern web
browsers. The PNG format is lossless and is best for line
diagrams and blocks of solid colour. The JPEG format is lossy,
but may be useful for image plots, for example.\end{Details}
\begin{Value}
A plot device is opened: nothing is returned to the \R{} interpreter.\end{Value}
\begin{Note}\relax
These are based on the \code{\Link{X11}} device, so the additional
arguments to that device work, but are rarely appropriate.  The
colour handling will be that of the \code{X11} device in use.\end{Note}
\begin{Author}\relax
Guido Masarotto and Brian Ripley\end{Author}
\begin{SeeAlso}\relax
\code{\Link{Devices}}, \code{\Link{dev.print}},
\code{\Link{bitmap}}\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## copy current plot to a PNG file
dev.print(png, file="myplot.png", width=480, height=480)
\end{ExampleCode}
\end{Examples}

