Skip to contents

Convert from a recolorize object to a list of RasterLayer objects, the format required by the patternize package. Note that most of the downstream patternize functions that require lists of RasterLayer objects mostly require lists of these lists, so you will probably need to use this function on a list of recolorize objects.

Usage

recolorize_to_patternize(recolorize_obj, return_background = FALSE)

Arguments

recolorize_obj

A recolorize object.

return_background

Logical.

Value

A list of RasterLayer objects, one per color class.

Details

Note that this function does not retain the colors of the layers -- you won't be able to convert back to a recolorize object from this object.

Examples


# \donttest{
# fit recolorize object:
img <- system.file("extdata/ephippigera.png", package = "recolorize")
rc <- recolorize2(img)
#> 
#> Using 2^3 = 8 total bins



# takes ~10 sec to run:
# convert to a raster list:
as_raster_list <- recolorize_to_patternize(rc)
# }