Mandy Mosaic
Video created with software developed in MATLAB to demonstrate convertion of photos to images composed of Lego bricks. In this case the resulting images have dimensions 64x64 studs (511mm square) and utilise a variety of colour palettes and conversion algorithms. The palettes are defined in csv files and the output can also be exported as a csv file to aid implementation with real bricks.
Algorithm key (weightings tuneable to taste):
INF (infinite): exact conversion of source colour to brick
RGB: weighted nearest-neighbour search in RGB space
HSV: weighted nearest-neighbour search in HSV space
INT (intensity): search for colour of similar brightness using
grayscale conversion of source and palette
HYB (hybrid): weighted mix of RGB and INT results.
Palette Key (not all colours are necessarily used in conversion):
P1: 110 colours. Comprehensive list of official Lego solid colours found at ryanhowerter.net/colors.php. Not all available outside of sets or as 1x1 plates.
P2: 16 colours. All 1x1 plates available individually from UK Lego Store in 2021
P3: 12 colours. General selection of colours from Smartable compatible bricks
P4: 12 colours. Selection of skin colours from Smartable range
P5: 80 colours. Complete range of Smartable 1x1 plates as of October 2021 smartable.aliexpress.com/store/1595237
Further development is possible: for example implementing colour converting Look Up Tables (LUT) or the introduction of controlled randomisation in the selection of brick colours.
Image used with permission.
Mandy Mosaic
Video created with software developed in MATLAB to demonstrate convertion of photos to images composed of Lego bricks. In this case the resulting images have dimensions 64x64 studs (511mm square) and utilise a variety of colour palettes and conversion algorithms. The palettes are defined in csv files and the output can also be exported as a csv file to aid implementation with real bricks.
Algorithm key (weightings tuneable to taste):
INF (infinite): exact conversion of source colour to brick
RGB: weighted nearest-neighbour search in RGB space
HSV: weighted nearest-neighbour search in HSV space
INT (intensity): search for colour of similar brightness using
grayscale conversion of source and palette
HYB (hybrid): weighted mix of RGB and INT results.
Palette Key (not all colours are necessarily used in conversion):
P1: 110 colours. Comprehensive list of official Lego solid colours found at ryanhowerter.net/colors.php. Not all available outside of sets or as 1x1 plates.
P2: 16 colours. All 1x1 plates available individually from UK Lego Store in 2021
P3: 12 colours. General selection of colours from Smartable compatible bricks
P4: 12 colours. Selection of skin colours from Smartable range
P5: 80 colours. Complete range of Smartable 1x1 plates as of October 2021 smartable.aliexpress.com/store/1595237
Further development is possible: for example implementing colour converting Look Up Tables (LUT) or the introduction of controlled randomisation in the selection of brick colours.
Image used with permission.