Stacks LEGO plates to create a 3D version of the 2D brick mosaics. Height of bricks determined by brightness of color.

bricks_from_mosaic(mosaic_list, mosaic_height = 6, highest_el = "light")

Arguments

mosaic_list

List output from image_to_bricks(). Contains an element Img_lego.

mosaic_height

Number of layers in the 3D image.

highest_el

Brick height is determined by brightness of color. Use highest_el = 'dark' for darkest bricks to have mosaic_height.

Value

A list with elements Img_lego to pass to build_bricks.

See also

Examples

# Import a jpeg or png demo_file <- system.file("extdata", "demo_img.jpg", package = "brickr", mustWork = TRUE) demo_image <- jpeg::readJPEG(demo_file) #Begin with a 24x24 mosaic object # \donttest{ mosaic <- demo_image %>% image_to_mosaic(24) # } #Pass the mosaic object to bricks_from_mosaic() to convert to 3D specifications # \donttest{ mosaic %>% bricks_from_mosaic() %>% build_bricks() rgl::clear3d() # } #In this image, the background is a light color. # Change the 'highest_el' to make dark colors highest # Change mosaic height to change the number of layers # \donttest{ mosaic %>% bricks_from_mosaic(mosaic_height = 3, highest_el = "dark") %>% build_bricks() rgl::clear3d() # }