Toggle open
Learning Library Blog Students Can Create a Work of Code Art
Expand breadcrumbs

Students Can Create a Work of Code Art

By Jerry Fingal
May 12, 2021
Code art small Version Id8eu H6 X8a5ig H Nguvo CP Cw68hnzs 4r5

Tim Needles is an advocate for bringing the arts to STEM education. But one of his favorite classroom projects actually brings STEM to the arts.

Needles, an art teacher at Smithtown High School East on Long Island, New York, puts STEM in his art classes by having his students use code to create works of art. The resulting “code art” is a digital drawing that draws itself on a screen.

“Creating a piece of code art is a really fun activity because you're using math, coding and syntax to create kind of a movable artwork that can actually evolve over time,” said Needles, the author of the ISTE book STEAM Power: Infusing Art in Your STEM Curriculum. “You can create code art that will continue drawing itself. It’s a really fun challenge.”

It all might sound a bit technical. But Needles says the availability of block-based coding language using programs such as and Scratch makes it simple. Students aren’t actually writing computer code but assembling blocks of commands. Even those who have never coded before can pick it up quickly.

“That’s the amazing thing,” he said. “I teach students who have never coded and after five or 10 minutes they’re making code art. And it’s one of those things that’s just fun to play with. It’s an engaging project.”

For those unfamiliar with code art, Needles likens it to an online version of the old-school Spirograph, which allowed someone to create geometric designs on paper with pens and a set of plastic wheels. With code art, shapes, colors and the drawing itself are all driven by computer code.


Needles introduces students new to coding by using the “Artist” section at More advanced students can use Scratch or other programming languages.

Depending on the interest of students and their abilities, code art can get very sophisticated, “which is really fun,” Needles said.

“It can get pretty complex,” he said. “The most interesting code art is often interactive. It could be reacting to sound in the classroom or motion. And there are now some Google tools that allow you to use your camera on your computer and use AI. So, you can have AI interact with the code art, which is pretty amazing.”

Needles said code art is a great segue to other projects. More and more edtech tools have the ability to interact with code and that broadens the possibilities, he said.

“We’ll make code art, and then we'll actually use robots and then have the robots draw the code,” he said. “So it's a great starter project. It sparks other ideas.”

Classes can spend as little as day on the project or extend it out for a week or more, Needles said.

“For the basic code art project, you could do that in a class period without a problem,” he said. “Even a one-day project to get exposed to how code works is really valuable.

“I like to take a week and let it progress and then get more advanced with it. It can be either a short, fun, interactive project for any classroom, or you can really get into it and extend it for quite a while, depending on what you're doing.”

In his book, Needles lays out the steps for the project:

Find the right tool.

For beginners, use lessons under the Artist section of More advanced students can explore different kinds of code art before deciding how to proceed.

Choose a drawing to create with code.

Beginners can create the entire project through the Artist section of More advanced students can use Scratch or another coding language.

Start coding.

The amount of time necessary depends on the complexity of the work.

Test the code.

If it doesn’t come out as envisioned, make technical or aesthetic changes.

Get feedback.

Share the project in class and online, and reflect on the process.

Meet Tim Needles in person when he hosts the Creativity Playground at ISTELive 23 in Philadelphia. Register today!

ISTE20 Reinventing Education Together graphic

Jerry Fingal is an education blogger who explores the intersection of technology and learning.