Вопрос

I'm trying to play around with turning an image into mosaic bricks like the Lego Photo app.

How is it done, and where can I find more info?

Это было полезно?

Решение

You basically need to iterate through the pixels, to calculate the average colour for say every 4x4 block of pixels. Once you have this average colour, you 'round' it to the nearest colour that you can use in your mosaic. I don't know the specifics of it but this sample code does exactly what you want.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top