File Exchange

image thumbnail


Matlab: Convert a normal image (or internet image) into Lego-style, similar to


Updated 09 Oct 2019

GitHub view license on GitHub

This is a Matlab function that converts a normal RGB image into a Lego-style image. The input can be either an image that has been imported into Matlab or the url address of an image anywhere on the internet.

The conversion is super easy, you only need to download the function


This function will take three arguments:

the image to convert,
the scale to pixelise and,
if you want to display block by block.

Arguments 2 and 3 are optional The image can be either an image or a URL.


Read an image from wikimedia and convert (no extra parameters). The results is saved in dataOut and displayed with a second line of code:

dataOut = Legofy('');

Cite As

Constantino Carlos Reyes-Aldasoro (2020). Legofy (, GitHub. Retrieved .

Comments and Ratings (0)

MATLAB Release Compatibility
Created with R2019b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags