RGB2PCT                package:rgdal                R Documentation

_C_o_n_v_e_r_t _R_G_B _t_h_r_e_e _b_a_n_d _t_o _s_i_n_g_l_e _b_a_n_d _c_o_l_o_u_r _t_a_b_l_e

_D_e_s_c_r_i_p_t_i_o_n:

     This function converts a three-band GDALReadOnlyDataset into a
     single band of colour indices as a GDALTransientDataset.

_U_s_a_g_e:

     RGB2PCT(x, band, driver.name = 'MEM', ncolors = 256, set.ctab = TRUE)

_A_r_g_u_m_e_n_t_s:

       x: a three-band GDALReadOnlyDataset object

    band: a vector of numbers, recycled up to 3 in length

driver.name: default MEM

 ncolors: a number of colours between 2 and 256

set.ctab: default TRUE, when the dithered dataset handle is returned,
          otherwise a list of the dataset and the PCT colour table

_V_a_l_u_e:

     The value returned is a either GDALTransientDataset or a list of a
     GDALTransientDataset and a colour table.

_A_u_t_h_o_r(_s):

     Tim Keitt

_R_e_f_e_r_e_n_c_e_s:

     <URL: http://www.gdal.org/>

_E_x_a_m_p_l_e_s:

     logo <- system.file("pictures/Rlogo.jpg", package="rgdal")[1]
     x <- GDAL.open(logo)
     dim(x)
     dx <- RGB2PCT(x, band=1:3)
     displayDataset(dx)
     dim(dx)
     GDAL.close(x)
     GDAL.close(dx)

