Python for Creative Coding: A Visual Artist’s Guide to Generative Art (2025)Learning Python For Your Creative Practice

py5 grid with drawing 10x10 grid python art

Python for Creative Coding: A Visual Artist's Guide to Generative Art (2025)

py5 grid with drawing 10x10 grid python art signed

Why Visual Artists Should Learn Python Programming

“Architecture is frozen music,” wrote Goethe, capturing how structure can evoke the harmony and rhythm of a composition.

In the same way, a two-dimensional design is frozen music. Repeating shapes, variations, and grids create an architectonic pleasure—a visual score.

This is why, in the Summer of 2025, I started learning Python. I want to expand my art and design practice, using code.

Python’s deep integration with AI will also become a critical tool, opening new creative pathways for my work.

I would also recommend you start learning Python for your creative practice too . With this blogpost ” Python for Creative Coding: A Visual Artist’s Guide to Generative Art (2025)Learning Python For Your Creative Practice ” I hope will help you start out.

Learning things like this gives me new tools in my art box that I can apply in my workflow. The first day of a digital spring.

I am not going to get too m much into the code here too  I am a Python learner. I am just going to talk about the basic concepts I learned.

If you are a visual person, you may find like myself, Python courses aren’t that stimulating.

I slogged through an initial Python for beginners book— As a visual learner, I only fully understood it when I took the code to an LLM such as ChatGPT and asked questions like “How do I use this in 3D?” As I did this, I started to understand the concepts of Python.

I need to learn by making and iterating. I also need to learn things that I can put to use in my work.

I often use the website Domestika to learn new thins and  this course jumped out at me =

Designing with Python: Programming for a Visual Context

A course by Alexandre B A Villares

I would highly recommend it.

Core Concepts: Grids To Generative Patterns

In the course abive, you get to learn Python concepts in a visual way. Particularly –

  1. How to install Thonny Python and Py5.
  2. How to make a loop to make a grid
  3. How to easily edit the grid rows and columns.
  4. How to create and  insert shape elements into each grid square at random.
  5. How to add “recursion” with some of the grid square so that the pattern repeats itself again smaller within that square. I like to think of it as “Universes within Universes”
  6. How to add a mouse click to change the composition again and again at random and press a key to save the compositions you are pleased with as PNG files.

As a tradigital artist who likes to combine digital with traditional methods. I wanted to use a simple 2D honeybee sketch in some of the cells. I wanted the work to elude to honeybees and summer flowers.

5. Due to this I went outside the course tutoring and added my own drawings tradigital, I had to look up and cheat (vibe code) and google to find out how to add an SVG of my original work. I’m still just a very early beginner learner of Python.

I also used the Adobe color palette creator  Link ,  to find a summer themed color harmony range. I then again used AI to extract the colors in the photo reference from the Adobe site and change the code to the particular scheme.,

You can check the code snippet below as to how to add an SVG of a vectorized drawing into the Py.5 framework . I will definitely be re using this in the future…

 

🐍
filename.py
def setup():
    size(700, 700)
    global bee_svg
    
    # Initialize the py5 sketch and load external SVG    assets. This function runs once when the program starts.

    try:
        bee_svg = load_shape("bee.svg")
        # Disable the SVG's internal style to allow color changes
        bee_svg.disable_style()
        print("bee.svg loaded successfully")
    except:
        print("Could not load bee.svg - using drawn stars for recursive elements instead")
        bee_svg = None
colour scheme
A color scheme based on summer found on the Adobe Color palette generator. website
visual sketch for Python Programming
Working out the grid on paper, with three objects to be repeated, bee, circle and hexagon

Results

py5 grid with drawing 6x6 grid python art v3 signed

“The bees gather hexagon honey from the digital late summer flowers”…

The coding is set up in the course so that when you press S, the image will save into a folder on your computer. Left clicking the mouse will change the image each time randomly changing the pattern.

So you can click the mouse untll you find a pattern you like. S will save that.

“The universal patterns and honeybee tasks repeat as we fly higher”…

You can also easily change the number of columns and rows of the grid like below 10×10.

py5 grid with drawing 10x10 grid python art signed

“Almost like a honeycomb now, patterns emerge, random or some kind of natural orfer?”….

Even to 15×15

py5 grid with drawing 15x15 grid python art signed
City!

Where Can We Take This Next?

With critical thinking skills, we should always think about how we can apply what we have learned. So how can I apply what I have learned here beyond making visual patterns? Some suggestions that come to mind are – 

  • Apply the designs to textiles and fine art signed prints.
  • Start to look to see how using AI and Python for these kinds of patterns could learn, adapt, flock. Stay tuned this is my next step..
  • Take it further in 3D  using something like ThreeJS and add interactivity to the 2D grid.
  • Work on the basic code concept for interactive experiences using Arduinos and the Touch Designer software.

I can help you to make 3D  and now integrate Python into your workflow Email   me to talk.

Useful Links

Designing with Python: Programming for a Visual Context. The Domestika  Link

Py5 the creative coding framework for Python Link

Alexandre B A Villares website tutor of the domestika course Link

Three.Js language I used for the 3D interactive version Link

Pyde Processing Python examples Link

The Python programming language Link

Buy versions of this print in my  Shop

Get in touch with me for a 121 trial tuition session Email

Explore Articles

long days big clouds

Spirit Of The Ages

August 1990, North Norfolk, England Unseen forces  were operating high above the flat North Norfolk skies. The long summer holidays became too bright, too windy,  

Read More »