Code has become something often solely tied to text. In that form, it seems less of a piece of art, but more like a boring and uncomprehensible piece of text to the masses. Hence, we wanted to change that perception. We also wanted to make coding fun, such that you are not just writing a program.

What it does

Gridd converts your source code (as of now, only works with python) to a piece of pixel art. The pixel colours are determined on the type of the word (data type, variable, if statements etc.), ASCII (for names) and syntax for the positioning of pixels. You insert your code into the software, and the software in turn produces a square work of art that is uniquely yours.

To further facilitate the notion of 'art', we also decided to make it customisable. Hence, you will be able to assign lets say orange to an if statement, blue to a data type, such that you have full control of the art you produce. In the future, we hope to see the creation of various communities of people who work hard to convert functionable code into beautiful pieces of pixel art. (Though we personally believe the abstract mess is a nice momento and representation of your code - imagine yourself framing a picture of your 'code art' in your room!)

Lastly, you will be able to share the code. Take a photo of the image and send it to your friends. When your friends insert the picture into the software, they will be able to receive your code (In text) in a file (we are about to finish this but the deadline is up.)

How we built it

We built it with a Python library and Pillow. We had to break the code down in to various types and represent each type using a different color. Code was interpreted syntactically and it was grouped into chunks of the same color, however individual characters of the code are determined by assigning their ascii value to the transparency index of its respective pixel.

Challenges we ran into

There were too many possibilites, and at first, the picture just looked like unicorn farts (a static mess of colours - no patterns at all). So we instead also changed the transparency for a better looking image. We also spent up to 9 hours just sorting out and adding various types of the code and assigning colours - in order for some form of order to exist in the pic.

Accomplishments that we're proud of

It managed to work. (Rafael, one of our members, also converted on of his first programs into an artwork via our software, which he has set as his wallpaper!)

What we learned

We learnt a lot about the different types of Python code and how to tweak the code and encoding to make the image look better.

What's next for Gridd

We want to improve and finalise the last segment - the sharing of code via the art. We also want to build communities of enthusiasts who will be able to make code that is both functional and beautiful.

Built With

Share this project: