Create a 2D LEGO mosaic from an image array
image_to_mosaic(img, img_size = 48, color_table = NULL, method = "cie94", color_palette = c("universal", "generic", "special"), dithering = FALSE, contrast = 1, use_bricks = NULL, brightness = 1, warhol = 1:3)
| img | Image to convert into mosaic. Usually from |
|---|---|
| img_size | Size of output image in pixel, where one pixel = one 'brick'. Use a single value (e.g. |
| color_table | Defaults to |
| method | 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 |
| 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 |
| dithering | Improves color of large, photo-realistic mosaics. |
| contrast | For |
| use_bricks | Array of brick sizes to use in mosaic. Defaults to |
| brightness | A value >1 will increase the brightness of the image while a positive value <1 will decrease the brightness. |
| warhol | Array of values |
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).
Other Mosaics: build_mosaic