designcoding
About Table of Contents Keywords Monthly Archive
Support designcoding!

Subdivide by Image Contrast

October 17, 2012 | Algorithms
#art #grasshopper #image-sampler #visualization #voronoi

This was my old plan to work with images in Grasshopper. Certainly, that was not the result I expected, but this could be counted as a starting point. After seeing beautiful circle packing compositions here, I decided to program Grasshopper, so that it’ll create a subdivision, based on image data.

Subdivide by Image Contrast Grasshopper definition

This was the initial version, just subdividing a plane with Voronoi points and visualizing it according to the image’s color values of proper UV coordinates. There is no interpretation on the points, they are just “random”. (Although I’m looking at the “random” computer functions differently after I studied Mandelbrot here), we may say, yes they are random and they are out of my intention to associate them to the content of the image.

The second challenge was to understand if Grasshopper can interpret not only the colors but the actual context of the image. In this example, I tried to tell GH that, the density of Voronoi points should be based on the image contrast. Therefore, this definition checks the closest 5 points for each one, getting their average hue value, and sorting all points based on the contrast of surrounding points. By selecting a % of these points and performing a Voronoi stuff, this definition creates subdivisions, somehow related to the color areas of an image. The results are as expected but still interesting. At first, the overall look of the image is identified, then eventually, more detailed areas are processed. Here are two experiments with famous paintings:

Subdivide by Image Contrast animation
Subdivide by Image Contrast art, grasshopper
Grasshopper definition (GHX)Download
Grasshopper definition (GHX)Download
Sample image (JPG)Download

Cite this post

Yazar, T. (2012, October 17). Subdivide by Image Contrast. designcoding. Retrieved August 21, 2026, from https://www.designcoding.net/image-contrast/

Related Posts

String Art in Rhino Python

June 19, 2025

String art is a cool art technique that combines geometry and aesthetics to recreate images using lines between pins. Here is a good reference to start studying it. In this post, I explored a custom Rhino Python script designed for Rhinoceros 7 and 8. It transforms a grayscale image into a dense web of threads. The algorithm analyzes the darkest areas of the image and connects pins in a circular layout to form compositions. The script begins by converting a…

ASCII Art in Grasshopper

August 24, 2024

ASCII art is a graphic design technique that uses characters from the ASCII (American Standard Code for Information Interchange) set to create images, symbols, and designs. This form of art involves arranging text characters to form a visual representation of objects, scenes, or abstract patterns. I first encountered this art form in the 90s through readme text files and computer games. Years later, attempting to automate it in Grasshopper was a lot of fun. My initial goal was to calculate…

Image Sampler Revisited

March 17, 2015

Image Sampler of Grasshopper saves life if used responsibly. While explaining the component to this year’s ARCH362 students, I used this simple example that generates numbers from a beautiful picture of “metal foam” and uses it to generate lots of circles: Metal foams are lightweight but strong materials, that are typically produced by injecting gas into the liquid metal. Of course, it becomes easier to teach something when you manage to attract the attention of students.

Image Processing Basics

November 1, 2013

This was the initial example of image processing in our Parametric Modeling class. Hand-drawn and digital diagrams can also be digitized and used in order to describe certain parameters for design formation. Such algorithms would similarly use the Image Sampler Component of Grasshopper. In the algorithm below, image data is used to capture black pixels as attractors of a Voronoi subdivision. A regular point grid is dispatched according to Brightness values so that the points that lie on the lines of…

Fibonacci Portraits

December 27, 2023

“In the heart of a sunflower’s embrace, its seeds weave a poetic tale—a dance of two spirals, parastichies they’re called. One unfurls gracefully from the center in the hush of clockwise whispers, while its counterpart whispers secrets in the tender breaths of counterclockwise motion. A subtle ballet unfolds, where the number of these spirals gracefully mirrors the whispers of adjacent Fibonacci numbers, composing a delicate symphony in the sun-kissed fields.” says ChatGPT if I force it to be a little…

  • Chapters

    • Algorithms
    • Discourses
    • Fabrications
    • Studios
  • Explore

    • All Keywords
    • Table of Contents
    • Monthly Archive
    • #rhino-python
    • #polyhedra
    • #robot
    • #tessellation
    • #kuka-prc
    • #parametric-surface
    • #animation
    • #dome
    • #design-object
    • #terrain
    • #sandblasting
    • #stone
    • #parametric-curve
    • #cycloid
    • #aperiodic
    • #tiling
    • #dodecahedron
    • #tutorial
    • #boolean
    • #archimedean-solid
  • Search

  • Support designcoding!

  • Enjoying designcoding? Support me on Patreon to keep it growing. Thank you!

  • copyright 2026 designcoding.net | about | privacy policy | end user license agreement