Sitemap

Canvas to Code — The Starry Night and Algorithms That Dream in Color

13 min readJun 11, 2025

--

Press enter or click to view image in full size
ChatGPT

“I often think that the night is more alive and more richly colored than the day.” — Vincent van Gogh

Introduction: When Code Becomes Poetry

In June 1889, at the Saint-Paul-de-Mausole psychiatric hospital in Saint-Rémy-de-Provence, Vincent van Gogh painted one of the most recognizable works in art history. “The Starry Night” was not just a painting — it was a visual algorithm that transformed the artist’s inner world into spiraling flows of color and light. Today, more than a century later, programmers around the world attempt to reproduce that same magic through code, seeking ways for their algorithms to not only function, but also dream.

Van Gogh’s “The Starry Night” represents the perfect metaphor for what every programmer tries to achieve when crossing the boundary between functionality and art. Just as Van Gogh transformed an ordinary night scene into a whirlwind of emotions and energy, so too do we, through creative coding, transform raw data into visual experiences that can touch the soul.

This painting speaks to us about procedural art generation, about algorithms that can create beauty, about how mathematical precision can give birth to poetic expression. Van Gogh’s brushstrokes were not random — they followed an inner logic, a pattern that can be analyzed, understood, and perhaps, programmed.

Spiral Algorithms: The Geometry of Emotions

The most striking element of “The Starry Night” are the spiral clouds that move through the sky like living organisms. These spiral forms did not arise by chance — they represent Van Gogh’s interpretation of turbulent air movement, a phenomenon that would only be mathematically described decades later through chaos theory and fractal geometry.

When a programmer observes these spirals, they see algorithms for fluid dynamics simulation. Van Gogh intuitively understood what we today code through Navier-Stokes equations — the way fluids move through space, creating vortices and turbulence. Each stroke of his brush was like an iteration in an algorithm, where previous states are used to create new, more complex patterns.

# Pseudocode for Van Gogh's spirals
for each_brushstroke in painting:
current_position = get_position()
wind_force = calculate_turbulence(current_position)
spiral_direction = apply_emotional_filter(wind_force)
paint_stroke(current_position, spiral_direction, intensity)

This analogy is not merely poetic — it is deeply practical. Modern algorithms for procedural generation of natural phenomena use similar principles. Perlin noise algorithms, used in video games to create realistic clouds and terrain, work in a similar way to Van Gogh’s spiral strokes. They combine mathematical precision with an element of unpredictability that makes the result natural and organic.

Colors as Data: A Palette That Speaks

Van Gogh’s use of color in “The Starry Night” represents a sophisticated information encoding system. Each color carries meaning, each tone communicates emotion. The yellow light of the stars is not just yellow — it is data about intensity, about warmth, about hope. The blue night sky is not just blue — it is information about depth, about mystery, about infinity.

This approach to color as an information system directly connects to modern concepts of data visualization. When a programmer creates a heat map or uses color coding to represent different types of data, they are applying the same principle that Van Gogh used. Color becomes language, a way of communication between system and user.

Van Gogh’s palette in “The Starry Night” can be analyzed as a carefully designed color scheme in a user interface. Contrasting colors (yellow and blue) are used to draw attention to key elements (stars and sky), while complementary shades are used to create harmony and visual flow. This is a principle that every UI/UX designer applies today when creating digital interfaces.

Texture as Algorithm: Impasto Technique and Pixel Art

Van Gogh’s characteristic impasto technique, where paint is applied in thick layers, creates texture that is almost sculptural. Every brushstroke is visible, every layer of paint adds depth and dimension. This technique can be viewed as an early form of pixel art, where each brushstroke represents one “pixel” in a larger composition.

Modern programmers working with procedural texture generation use similar principles. Algorithms for bump mapping and displacement mapping in 3D graphics work on the same principle as Van Gogh’s impasto technique — they add visual and tactile depth to a surface that is essentially flat. Each “stroke” of the algorithm adds a layer of information that contributes to the final visual effect.

// GLSL shader that imitates Van Gogh's texture
float vanGoghTexture(vec2 uv) {
float noise1 = noise(uv * 10.0);
float noise2 = noise(uv * 20.0) * 0.5;
float noise3 = noise(uv * 40.0) * 0.25;

float brushStroke = sin(uv.x * 15.0 + noise1 * 3.0) *
cos(uv.y * 12.0 + noise2 * 2.0);

return noise1 + noise2 + noise3 + brushStroke * 0.3;
}

This approach to texture as an information layer is particularly relevant in the context of responsive design. Just as Van Gogh uses different stroke densities to create visual hierarchy, programmers also use different levels of detail depending on screen size and usage context.

Composition as Architecture: Structure That Breathes

The composition of “The Starry Night” represents a masterful example of an architectural approach to visual design. Van Gogh carefully organized the elements of the painting into three main layers: the dynamic sky in the upper part, the peaceful village in the middle part, and the dark cypress that connects earth and sky. This three-part structure can be viewed as elegant software architecture with clearly defined layers of responsibility.

The upper layer — the sky with spiral clouds and stars — represents the presentation layer in software architecture. This is the part that the user sees, that attracts attention and creates emotional response. Just as Van Gogh’s sky dominates the painting with its dynamism, a well-designed user interface must be visually appealing and functional.

The middle layer — the peaceful village with houses and church — represents the business logic layer. This is the heart of the application, the part that does the actual work, but often remains unnoticed in the background. Van Gogh’s village is painted with simpler strokes, with fewer details, reflecting the way business logic should be elegant and efficient, without unnecessary complexity.

The bottom layer — the dark cypress that rises through the entire painting — represents the data layer, the infrastructure that connects all other components. Just as the cypress connects earth and sky, the data layer connects user requests with business logic and the database.

class StarryNightArchitecture:
def __init__(self):
self.presentation_layer = SkyWithStars() # Dynamic, attractive
self.business_layer = PeacefulVillage() # Functional, efficient
self.data_layer = CypressTree() # Connects all components

def render_scene(self):
foundation = self.data_layer.establish_connection()
logic_result = self.business_layer.process(foundation)
return self.presentation_layer.display(logic_result)

This architectural analogy is particularly useful when discussing system scalability. Van Gogh’s composition functions at different levels of observation — from afar we see the entire scene, up close we can analyze individual brushstrokes. Similarly, good software architecture must function at different levels of abstraction.

Light as Performance: Optimization That Dazzles

The way Van Gogh uses light in “The Starry Night” represents a masterful lesson in performance optimization. The stars are not simply painted as bright dots — they radiate energy through concentric circles of light that spread through the sky. This technique creates the illusion of intense glow using minimal resources — just a few brushstrokes per star.

This approach directly connects to the concept of optimization in programming. Just as Van Gogh achieves maximum visual effect with a minimum number of strokes, good programmers achieve maximum functionality with a minimum number of lines of code. The “less is more” principle that Van Gogh applies in representing starlight is reflected in programming principles such as DRY (Don’t Repeat Yourself) and KISS (Keep It Simple, Stupid).

// Van Gogh's approach to starlight
function createStarGlow(centerX, centerY, intensity) {
const glowLayers = [];

// Instead of complex calculations, use simple concentric circles
for (let radius = 1; radius <= 3; radius++) {
glowLayers.push({
x: centerX,
y: centerY,
radius: radius * 10,
opacity: intensity / radius,
color: interpolateColor('yellow', 'white', radius / 3)
});
}

return glowLayers;
}

Van Gogh’s use of light also demonstrates the importance of visual hierarchy in interface design. The brightest stars attract attention first, then the moon, and only then other elements. This hierarchy of light can be directly applied in web design through the use of different levels of contrast, font weight, and color saturation.

Particularly interesting is how Van Gogh uses light reflection on water in the lower part of the painting. This reflection is not a perfect copy of the light above — it is stylized and adapted to context. Similarly, in programming we often use caching mechanisms that are not perfect copies of original data, but optimized versions adapted to specific performance needs.

Emotions as User Experience: Design That Feels

“The Starry Night” is not just a visual masterpiece — it is an emotional journey. Van Gogh managed to convey his inner state through every element of the painting, from the restless spirals in the sky to the peaceful lights in the houses. This ability to convey emotions through visual medium represents the pinnacle of user experience design.

When we analyze how Van Gogh creates emotional response, we see that he uses the same principles that modern UX designers apply. The contrast between the dynamic sky and peaceful village creates a sense of tension and resolution, similar to how a good application creates moments of challenge followed by a sense of achievement.

Van Gogh’s use of movement in the painting — spiral clouds, undulating starlight, vertical cypress — creates a visual rhythm that guides the eye through the composition. This principle is directly applied in user interface design through concepts such as visual flow and eye tracking patterns.

/* CSS animation inspired by Van Gogh's spirals */
@keyframes vanGoghSpiral {
0% {
transform: rotate(0deg) scale(1);
filter: hue-rotate(0deg);
}
50% {
transform: rotate(180deg) scale(1.1);
filter: hue-rotate(30deg);
}
100% {
transform: rotate(360deg) scale(1);
filter: hue-rotate(0deg);
}
}

.starry-night-element {
animation: vanGoghSpiral 8s ease-in-out infinite;
transform-origin: center;
}

Van Gogh’s ability to create a sense of depth and space using only color and texture can be connected to the concept of responsive design. Just as Van Gogh adapts his technique to different parts of the painting (more detailed village, more abstract clouds), responsive design adapts the interface to different devices and usage contexts.

Get Mihailo Zoin’s stories in your inbox

Join Medium for free to get updates from this writer.

Most importantly, “The Starry Night” demonstrates how technical skill can serve emotional expression. Van Gogh’s mastery of technique is not an end in itself — it is a means of conveying deeper meanings. Similarly, programming skill should serve to create meaningful user experiences, not just demonstrate technical ability.

Iterative Process: From Sketch to Masterpiece

Van Gogh did not paint “The Starry Night” in one stroke. Like every great artist, he went through an iterative process of sketching, experimenting, and refining. Existing sketches and letters show that Van Gogh thought long about the composition, tested different approaches, and gradually developed the final version.

This iterative approach directly connects to agile methodologies in software development. Just as Van Gogh creates a series of sketches before the final painting, programmers create prototypes, MVP (Minimum Viable Product) versions, and iteratively improve the product based on feedback.

Van Gogh’s process can be mapped to modern development cycles:

1.Research and inspiration — Analysis of existing solutions, research phase

2.Initial sketches — Wireframes and mockups

3.Color experimentation — UI/UX testing

4.Composition refinement — Code review and optimization

5.Final implementation — Production deployment

class VanGoghDevelopmentProcess:
def __init__(self):
self.iterations = []
self.current_version = None

def sketch_initial_idea(self, concept):
"""Initial sketch - MVP version"""
wireframe = self.create_wireframe(concept)
self.iterations.append(wireframe)
return wireframe

def experiment_with_colors(self, wireframe):
"""Testing different approaches"""
color_variations = []
for palette in self.available_palettes:
variation = self.apply_palette(wireframe, palette)
user_feedback = self.get_feedback(variation)
color_variations.append((variation, user_feedback))
return self.select_best_variation(color_variations)

def refine_composition(self, design):
"""Iterative improvement"""
while not self.is_satisfactory(design):
design = self.apply_improvements(design)
self.iterations.append(design)
return design

def create_masterpiece(self, concept):
"""Complete development cycle"""
sketch = self.sketch_initial_idea(concept)
colored_design = self.experiment_with_colors(sketch)
refined_design = self.refine_composition(colored_design)
self.current_version = refined_design
return refined_design

Van Gogh’s ability to learn from his previous works and continuously improve his technique reflects the principle of continuous learning that is crucial in programming. Just as Van Gogh analyzes his previous painting to improve the next one, programmers use code reviews, postmortem analyses, and retrospectives to continuously improve their work.

Technical Innovation: When Art Predicts Technology

Van Gogh’s “The Starry Night” represents a fascinating example of how art can predict technological innovations. The spiral forms that Van Gogh painted in 1889 are today recognized as visual representations of complex mathematical concepts that were formally described only decades later.

The turbulent flows in Van Gogh’s sky correspond to what we today call Kolmogorov turbulence — a mathematical model that describes how energy is transferred through different scales in turbulent fluid. Van Gogh intuitively understood these principles and visually represented them before they were mathematically formalized.

import numpy as np
import matplotlib.pyplot as plt

def van_gogh_turbulence(x, y, time):
"""
Simulation of Van Gogh's spiral flows
using modern fluid dynamics algorithms
"""
# Basic vortex pattern
vortex1 = np.sin(x * 0.1 + time) * np.cos(y * 0.1)
vortex2 = np.cos(x * 0.15 - time * 0.8) * np.sin(y * 0.12)

# Adding turbulent components
turbulence = (np.sin(x * 0.3 + y * 0.2 + time * 2) *
np.cos(x * 0.25 - y * 0.18 + time * 1.5))

# Combining components as Van Gogh combines brushstrokes
return vortex1 + vortex2 * 0.7 + turbulence * 0.3

def generate_starry_night_field(width=800, height=600):
"""Generates vector field inspired by The Starry Night"""
x = np.linspace(0, 10, width)
y = np.linspace(0, 7.5, height)
X, Y = np.meshgrid(x, y)

# Simulation of Van Gogh's spirals through time
time_steps = 100
for t in range(time_steps):
field = van_gogh_turbulence(X, Y, t * 0.1)
yield field

This technical analysis of Van Gogh’s painting reveals deeper principles that can be applied in modern programming. Van Gogh’s approach to combining different types of movement (spiral, undulating, linear) corresponds to the way modern algorithms combine different types of data transformations.

Scalability Through Simplicity: Lessons in Architecture

One of the most impressive characteristics of “The Starry Night” is its ability to function at different levels of observation. From afar, the painting appears as a coherent whole with a clear visual narrative. Up close, each part of the painting reveals rich texture and details that contribute to the overall effect.

This principle of scalability through simplicity is directly applied in software system design. Just as Van Gogh’s painting uses simple elements (brushstrokes, basic colors) to create complex composition, good software architecture uses simple components to create complex functionalities.

// Architecture inspired by Van Gogh's approach
class StarryNightSystem {
constructor() {
// Simple basic elements
this.brushStrokes = new BrushStrokeManager();
this.colorPalette = new ColorPalette(['blue', 'yellow', 'white', 'black']);
this.composition = new CompositionEngine();
}

// Combining simple elements into complex structures
createSky() {
const spirals = this.brushStrokes.createSpirals({
count: 3,
intensity: 'high',
direction: 'clockwise'
});

const stars = this.brushStrokes.createStars({
count: 11,
glow: true,
color: this.colorPalette.getColor('yellow')
});

return this.composition.combine(spirals, stars);
}

createVillage() {
const houses = this.brushStrokes.createSimpleShapes({
type: 'rectangle',
count: 8,
style: 'minimal'
});

const church = this.brushStrokes.createLandmark({
type: 'spire',
prominence: 'medium'
});

return this.composition.arrange([houses, church], 'horizontal');
}

// Main render method that combines all components
render() {
const sky = this.createSky();
const village = this.createVillage();
const cypress = this.brushStrokes.createVerticalElement({
height: 'full',
texture: 'flame-like'
});

return this.composition.layer([sky, village, cypress]);
}
}

Van Gogh’s approach demonstrates how complexity can be elegantly managed through hierarchical organization. Each part of the painting has its role, but all parts work together to create a unique experience. This is a key principle in microservices design and modular applications.

Performance Through Constraints: Creativity Within Limits

Van Gogh painted “The Starry Night” using a limited color palette and relatively simple techniques. These constraints were not obstacles — they were catalysts for creativity. Limited by the number of colors, Van Gogh was forced to find innovative ways to create depth, movement, and emotion.

This approach directly connects to the concept of performance optimization in programming. Just as Van Gogh achieves spectacular effects with limited resources, programmers must create efficient solutions within the constraints of memory, processing power, and bandwidth.

class ConstrainedPalette:
"""
Van Gogh's approach to limited palette
as a metaphor for resource-constrained programming
"""
def __init__(self):
# Limited palette - like limited memory
self.primary_colors = ['blue', 'yellow']
self.secondary_colors = ['white', 'black']
self.mixed_colors_cache = {} # Caching for optimization

def mix_colors(self, color1, color2, ratio=0.5):
"""Creating new colors through mixing - like function composition"""
cache_key = f"{color1}_{color2}_{ratio}"

if cache_key in self.mixed_colors_cache:
return self.mixed_colors_cache[cache_key]

# Simulation of Van Gogh's color mixing
mixed_color = self._blend_colors(color1, color2, ratio)
self.mixed_colors_cache[cache_key] = mixed_color

return mixed_color

def create_gradient(self, start_color, end_color, steps):
"""Creating gradient with minimal resources"""
gradient = []
for i in range(steps):
ratio = i / (steps - 1)
gradient_color = self.mix_colors(start_color, end_color, ratio)
gradient.append(gradient_color)
return gradient

def optimize_palette_usage(self, required_colors):
"""Optimizing color usage - like memory management"""
optimized_palette = []

for color in required_colors:
if color in self.primary_colors or color in self.secondary_colors:
optimized_palette.append(color)
else:
# Find closest combination of existing colors
closest_mix = self._find_closest_color_mix(color)
optimized_palette.append(closest_mix)

return optimized_palette

Van Gogh’s ability to create the illusion of complexity through simple elements reflects principles such as code reusability and DRY (Don’t Repeat Yourself). Instead of creating completely new techniques for each part of the painting, Van Gogh uses variations of the same basic brushstrokes, adapting them to the specific needs of each element.

Conclusion: Code That Dreams

Vincent van Gogh’s “The Starry Night” is not just a painting — it is a manifesto about how technical skill can serve a higher purpose. Van Gogh shows us that mastery of technique is not an end in itself, but a means of creating something that transcends the sum of its parts.

For programmers, “The Starry Night” represents inspiration to view their code not just as a functional whole, but as creative expression. Every line of code, like every stroke of Van Gogh’s brush, can contribute to a greater vision. Algorithms can be poetry, architecture can be art, and user experience can be an emotional journey.

Van Gogh’s painting teaches us that constraints can be catalysts for creativity, that simplicity can give birth to complexity, and that technical precision can serve emotional expression. When we program, we don’t just create functionality — we create experiences, solve problems, and perhaps, if we’re lucky, create something that will, like “The Starry Night,” outlive its time and inspire future generations.

The next time you sit down to code, remember Van Gogh’s spiral clouds. Ask yourself: does your code just function, or does it also dream? Do your algorithms just process data, or do they create beauty? Does your application just solve a problem, or does it also touch the soul?

In a world where technology is becoming increasingly dominant, Van Gogh’s “The Starry Night” reminds us that the goal of technology is to serve humanity, to create beauty, and to make the world a better place. As programmers, we are modern artists, and our code is our brush. It’s time to start painting masterpieces.

“I dream of a painting, and then I paint my dream.” — Vincent van Gogh

Perhaps it’s time we start dreaming about code, and then program our dreams.

Announcement:

Discover how timeless masterpieces inspire modern programmers in our upcoming book Canvas to Code — or How World-Famous Works of Art Inspire Developers. This exclusive excerpt explores Vincent van Gogh’s The Starry Night as a metaphor for creativity in coding, blending art and algorithms into poetic expression.

🔥 Don’t miss new articles that dive deep into the intersection of art and technology!
👉 Subscribe now to stay updated and be the first to unlock more insights that will fuel your creativity and innovation.

👏 If you enjoyed this article, tap to applaud and share it with fellow creators and coders!

--

--

Mihailo Zoin
Mihailo Zoin

Written by Mihailo Zoin

Stop collecting AI tools. Start building a thinking system https://outofboxprogramming.gumroad.com/