> ## Content Index
> Fetch the complete content index at: https://www.luisnatera.photo/llms.txt
> Use this file to discover other available public pages before exploring further.

# 005 - Pixels & Patterns: A Photography + Python Experiment
- URL: https://www.luisnatera.photo/005-pixels-patterns-photography-python-experiment/
- Published: 2025-09-15T19:28:44.000Z
- Updated: 2026-05-15T07:21:07.000Z
- Description: This week I’m mixing photography with code to uncover the hidden rhythms inside my images. A small experiment with big surprises.
- Author: Luis Natera
- Tags: python, street photography, side projects, algorithms

Hello dear reader!

Welcome to another issue of this newsletter. This week I want to talk about running experiments in photography, especially on combining photography with Python. To break up the text, I’ll include some photos from the archive.

In this issue:

- Experimenting with photography and Python
- Photographies from the archive

![](https://storage.ghost.io/c/19/ae/19ae7b7e-3267-4ec9-a3d4-d56fe8dd66fb/content/images/2025/09/20250629-DSCF4583_with_strip.png) 

## Sign up now

Subscribe 

Email sent! Check your inbox to complete your signup. 

Get the latest in your inbox

---

Today I’m building a bridge between photography, software development, and cities. I want to explore how photography lets us capture an instant of life in a city and then, using a bit of software, abstract the image to its minimum.

![Pixel pattern generated from a photograph using Python code](https://storage.ghost.io/c/19/ae/19ae7b7e-3267-4ec9-a3d4-d56fe8dd66fb/content/images/2025/09/20250327-DSCF7506_with_strip-1.png)

![Abstract pattern created by processing photography with Python](https://storage.ghost.io/c/19/ae/19ae7b7e-3267-4ec9-a3d4-d56fe8dd66fb/content/images/2025/09/20250405-DSCF8033_with_strip-1.png)

For some time, and while building [PostFlow](https://postflow.photo/?ref=luisnatera.photo), I’ve been thinking about the data encapsulated in a photo—the decisions we make as photographers—and how those choices get embedded in a single image or in a body of work. From orientation to color (or the absence of it) and other properties, every photograph isn’t just a story being told, but also a collection of micro-decisions made by the photographer.

Having that in mind I decided to build a simple experiment to answer the question: What would my photo looked like if the pixels were compressed along the longitudinal edge? In other words, what’s the rhythm of the image from left to right?

![Color extraction experiment combining photography and code](https://storage.ghost.io/c/19/ae/19ae7b7e-3267-4ec9-a3d4-d56fe8dd66fb/content/images/2025/09/20250415-DSCF9718_with_strip.png)

![Pixelated transformation of a street photograph](https://storage.ghost.io/c/19/ae/19ae7b7e-3267-4ec9-a3d4-d56fe8dd66fb/content/images/2025/09/20250524-DSCF2651_with_strip.png)

To answer it, I built a script to analyze my photos. It’s a simple python program that takes a photo, iterates over every pixel in the X-axis, and calculates the average color of all pixels along the Y-axis. Then, it builds a new image. A sequence of pixels that reveals a unique rhythm.

```python
from PIL import Image
import numpy as np
from pathlib import Path

def make_color_strip(input_path: str, output_path: str):
    # Load image
    img = Image.open(input_path).convert("RGB")
    arr = np.array(img)

    # Compute average color per column
    avg_colors = arr.mean(axis=0).astype(np.uint8)

    # Create strip: height = 150px for visibility
    height = 150
    width = arr.shape[1]
    strip = np.zeros((height, width, 3), dtype=np.uint8)

    for x in range(width):
        strip[:, x] = avg_colors[x]

    # Save output
    Image.fromarray(strip).save(output_path)
    print(f"Color strip saved to {output_path}")

if __name__ == "__main__":
    images_dir = Path("images")
    for img_file in images_dir.iterdir():
        if img_file.suffix.lower() in [".jpg", ".jpeg", ".png", ".bmp", ".tiff", ".webp"]:
            output_file = img_file.with_name(f"{img_file.stem}_color_strip.png")
            make_color_strip(img_file, output_file)

```

When we see the strips, they reveal different patterns. In some cases, a sequence of colors; in others, the dominance of a single tone or just a subtle detail. One question I want to keep exploring is about the colors and patterns I consciously or unconsciously decide to capture in my photography.

![Grid pattern generated from image color data with Python](https://storage.ghost.io/c/19/ae/19ae7b7e-3267-4ec9-a3d4-d56fe8dd66fb/content/images/2025/09/color_strips_combined.png)

14 images compressed.

## Don’t Miss Out

Subscribe 

Email sent! Check your inbox to complete your signup. 

Weekly notes on creativity, tech, and urban living.

I was inspired to try this experiment after learning about the work of [Adam Magyar](https://www.magyaradam.com/wp/?ref=luisnatera.photo), especially his series [Urban Flow](https://www.magyaradam.com/wp/?page%5Fid=478&ref=luisnatera.photo), in which he used a high-speed camera to capture a single strip of light and condense the passing of time. In his case, he captured movement and blurred static elements. I took his work as inspiration to build these strips. To emphasize the changes captured in a photograph.

![Side-by-side comparison of original photo and code-generated pattern](https://storage.ghost.io/c/19/ae/19ae7b7e-3267-4ec9-a3d4-d56fe8dd66fb/content/images/2025/09/20241026-DSCF2260_with_strip.png)

![Abstract mosaic created from photograph pixel values](https://storage.ghost.io/c/19/ae/19ae7b7e-3267-4ec9-a3d4-d56fe8dd66fb/content/images/2025/09/20250126-DSCF6105_with_strip.png)

![Python-generated color palette extracted from a photograph](https://storage.ghost.io/c/19/ae/19ae7b7e-3267-4ec9-a3d4-d56fe8dd66fb/content/images/2025/09/20250425-DSCF0969_with_strip.png)

![Geometric pattern derived from photographic color data](https://storage.ghost.io/c/19/ae/19ae7b7e-3267-4ec9-a3d4-d56fe8dd66fb/content/images/2025/09/20250621-DSCF4423_with_strip.png)

![Final result of the photography and Python experiment](https://storage.ghost.io/c/19/ae/19ae7b7e-3267-4ec9-a3d4-d56fe8dd66fb/content/images/2025/09/20250629-DSCF4567_with_strip.png)

As I evolve my photography practice, I aim to introduce new ways of seeing and experimenting with my photos, and with my approach to photography. Keep experimenting, keep learning.

What do you think? What are some subtle changes you’d like to capture? Or experiments you’d like to try with your creative habits? Leave a comment; I would love to hear from you.

---

That’s it for today! If you enjoyed this issue, **share it with a friend!** Know someone experimenting with photography? Send it their way, it might inspire them too.

Luis