Project 1: Quilting Barcelona

By Alejandrina Patron Lopez

Seeing some of the photos I have taken in Barcelona, I felt like I wanted to do something fun with them. I knew I wanted to create some sort of puzzle or pattern, and in the end I decided to write code that manipulated my photos and turned them into a "quilt." After turning some photos into quilts, I kept manipulating them to obtain a "pixel mosaic."

To turn the photos into quilts, I wrote code that generated random coordinates from the input image, and cropped squares (40 x 40 pixels each) out of it to create the output image. To create the pixel mosaics, I divided each quilt into squares of 16 x 16 pixels, and assigned to each the color value in the middle pixel.

Click here to see the code.

Here is some example output that I got (all photos taken by me):

Input Quilt Pixel Mosaic
Fruit at La Boqueria Fruit at La Boqueria Fruit at La Boqueria
Brunch at Gaudi Bakery Brunch at Gaudi Bakery Brunch at Gaudi Bakery
Flower closeup at Parc de Cervantes Flower closeup at Parc de Cervantes Flower closeup at Parc de Cervantes
Coffee break after class Coffee break after class Coffee break after class
Bee closeup at Parc de Cervantes Bee closeup at Parc de Cervantes Bee closeup at Parc de Cervantes
Exploring the great city of Barcelona Exploring the great city of Barcelona Exploring the great city of Barcelona

Do not click here.