# NOT RUN {
# 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
# }
# NOT RUN {
mosaic <- demo_image %>%
image_to_mosaic(24)
# }
# NOT RUN {
#Pass the mosaic object to bricks_from_mosaic() to convert to 3D specifications
# }
# NOT RUN {
mosaic %>%
bricks_from_mosaic() %>%
build_bricks()
rgl::clear3d()
# }
# NOT RUN {
#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
# }
# NOT RUN {
mosaic %>%
bricks_from_mosaic(mosaic_height = 3, highest_el = "dark") %>%
build_bricks()
rgl::clear3d()
# }
Run the code above in your browser using DataLab