CRcolor_to_transparent: Sets color in image to transparent.

View source: R/CRcolor_to_transparent.R

CRcolor_to_transparentR Documentation

Sets color in image to transparent.

Description

Takes image_list loaded with CRload_image and sets color specified in color_list to transparent. Index argument specifies which image to use.

Usage

CRcolor_to_transparent(image_list, index, color_list, status = NULL)

Arguments

image_list

Image_list created with CRload_image.

index

Index of image in image_list.

color_list

Color_list with elements r, g, b (and possibly a) specifying color in image to set to transparent.

status

Optional list status with elements value and message to retrieve warnings and error messages.

Details

Images are first loaded with CRload_image and can later be rendered to screen using CRdraw_image. Note that eventual effects of transparent colors are affected by blend mode set via CRset_blend_mode.

Examples

    CRset_blend_mode(gs, "blend")
    myimage <- CRload_image(list(), "C:/Users/me/picture_of_me.jpg")
    CRcolor_to_transparent(myimage, 1, list(r = 255, g = 110, b = 40))

lorweiuk/CREx documentation built on March 16, 2024, 3:04 a.m.