scaled_to_colors: Convert image output from scale_image() to bricks

Description Arguments Value

View source: R/image-to-prep-mosaic.R

Description

Match raw color channel values to a smaller subset of colors.

Arguments

image_list

List output from scale_image(). Contains an element Img_scaled.

method

Default 'cie94'. The method to use for comparison. Either 'brickr_classic', 'euclidean', 'cie1976', 'cie94', 'cie2000', or 'cmc'. 'brickr_classic' is an explicit euclidean distance formula, but yield different results than 'euclidean' in farver. See farver::compare_colour.

color_table

Defaults to lego_colors. Data frame of brick colors to map onto image. Must contain Name and R, G, B channels. See attached data lego_colors as examples.

color_palette

Brick color rarity to use. Defaults to all colors: 'universal' (most common), 'generic', and 'special' (least common). This is useful when trying to build the mosaic out of real bricks. Use "bw" for only grayscale bricks. Ignored if a color_table is supplied.

trans_bg

If img is a png has a transparent background, name of color to replace the background.

dithering

Improves color of large, photo-realistic mosaics.

contrast

For color_palette = "bw". A value >1 will increase the contrast of the image while a positive value <1 will decrease the contrast.

default_piece_type

Piece type to use in absence of piece_type column.

Value

A list with element Img_lego containing a data frame of the x- & y-coordinates, R, G, B channels, and mapped color of each brick (pixel).


brickr documentation built on Aug. 3, 2020, 1:07 a.m.