Reduce image color to either 2 or 8 colors for cartoonized effect

reducolor(style, input_path, output_path = NULL)

Arguments

style

integer either 0 or 1 0 for white and black colors 1 for 8 colors

input_path

character the image file path

output_path

character if not Null, the modified image will be saved in the provided folder path and name

Value

modified image array

Examples

input_path <- system.file("tmp_image", "mandrill.jpg", package = "rimager") new <- reducolor(0, input_path, "new.jpg") OpenImageR::imageShow(new)