1\name{RGB2PCT}
2\alias{RGB2PCT}
3%- Also NEED an '\alias' for EACH other topic documented here.
4\title{Convert RGB three band to single band colour table}
5\description{
6  This function converts a three-band GDALReadOnlyDataset into a single band of colour indices as a GDALTransientDataset.
7}
8\usage{
9RGB2PCT(x, band, driver.name = 'MEM', ncolors = 256, set.ctab = TRUE)
10}
11%- maybe also 'usage' for other objects documented here.
12\arguments{
13  \item{x}{a three-band GDALReadOnlyDataset object}
14  \item{band}{a vector of numbers, recycled up to 3 in length}
15  \item{driver.name}{default MEM}
16  \item{ncolors}{a number of colours between 2 and 256}
17  \item{set.ctab}{default TRUE, when the dithered dataset handle is returned, otherwise a list of the dataset and the PCT colour table}
18}
19
20\value{
21The value returned is a either GDALTransientDataset or a list of a GDALTransientDataset and a colour table.
22}
23\references{\url{https://gdal.org/}}
24\author{Tim Keitt}
25
26\examples{
27\dontrun{
28logo <- system.file("pictures/Rlogo.jpg", package="rgdal")[1]
29x <- GDAL.open(logo)
30dim(x)
31dx <- RGB2PCT(x, band=1:3)
32displayDataset(dx, reset.par=FALSE)
33dim(dx)
34GDAL.close(x)
35GDAL.close(dx)
36}
37}
38\keyword{spatial}
39