Turn a tk image object to an R raster object

tcl_img_2_r_raster(img)

Arguments

img

a tk image object

Examples

if(requireNamespace("grid")) { puglia <- list.files(file.path(find.package(package = 'loon'), "images"), full.names = TRUE)[1L] # `img` is a tk image object img <- setNames(l_image_import_files(puglia), tools::file_path_sans_ext(basename(puglia))) raster <- tcl_img_2_r_raster(img) grid::grid.newpage() grid::grid.raster(raster) }