<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Misha.studio on Medium]]></title>
        <description><![CDATA[Stories by Misha.studio on Medium]]></description>
        <link>https://medium.com/@misha.studio?source=rss-c59c4dc45014------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*RW_qNQfPP3RYBiqkuhupRg.jpeg</url>
            <title>Stories by Misha.studio on Medium</title>
            <link>https://medium.com/@misha.studio?source=rss-c59c4dc45014------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 08:24:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@misha.studio/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Generating a scribble — Behind the algorithm: Warcler]]></title>
            <link>https://medium.com/@misha.studio/generating-a-scribble-behind-the-algorithm-warcler-2bb7c93e329c?source=rss-c59c4dc45014------2</link>
            <guid isPermaLink="false">https://medium.com/p/2bb7c93e329c</guid>
            <category><![CDATA[art]]></category>
            <category><![CDATA[processing]]></category>
            <category><![CDATA[generative-art]]></category>
            <category><![CDATA[graphic-design]]></category>
            <category><![CDATA[creative-coding]]></category>
            <dc:creator><![CDATA[Misha.studio]]></dc:creator>
            <pubDate>Sun, 08 Jan 2023 00:00:19 GMT</pubDate>
            <atom:updated>2023-01-29T18:37:40.717Z</atom:updated>
            <content:encoded><![CDATA[<h3>Generating a scribble — Behind the algorithm: Warcler</h3><p>I often start my generative work with a question about how to create something. This time, I asked myself how to generate a random scribble. I decided to use a random walker algorithm with arcs for its paths. In this post, I’ll explain the process of making the algorithm and how I turned it into a generative artwork.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z_Bbj8Z_8jDIGe7CWAoi6g.png" /></figure><h3>What is a ‘Random walker’?</h3><p>Wikipedia has a nice explanation:</p><blockquote><em>“In mathematics, a random walk is a random process that describes a path that consists of a succession of random steps on some mathematical space.” Source: Wikipedia</em></blockquote><p>In other words, a random walker is a path that is created step-by-step where each step has been taken randomly. The idea is simple, start somewhere and then randomly move (walk) to a next point. Repeat this process and eventually the canvas will be filled with a random path. There are a lot of generative artist/teachers out there who have explained more about this topic. See for example this <a href="https://www.youtube.com/watch?v=rqecAdEGW6I">video</a> from The Nature of Code by Daniel Shiffman or this <a href="https://happycoding.io/tutorials/processing/animation/random-walker">Happy Coding webpage</a> by Kevin Workman.</p><h3>Getting started</h3><p>I started sketching out how the algorithm could draw a single arc and start ‘walking’ from there. The algorithm would need to execute the following steps:</p><ol><li>Generate an initial arc with a (random) postion, start &amp; end angle</li><li>Find the end point of the previous generated arc</li><li>Calculate a new random arc turning left or right joining the end point</li><li>Repeat steps 2 &amp; 3</li></ol><h3>Setting up</h3><p>I use Processing Java for most of my generative design work. Java is an object-oriented programming language which means that you use a lot of classes. Classes are basically ‘blueprints’ for objects that you use in your code. For the ‘Warcler’ algorithm I created a class for the step — the arc. It looked something like below. With this blueprint I can create an arc by specifying its center position, radius and start and end angles.</p><pre>class Arc {<br><br>  PVector center;<br>  PVector start, end;<br>  float startAngle, endAngle;<br>  float radius;<br><br>  Arc ( PVector _pos, float _r, float _startAngle, float _endAngle) {<br>    center =  _pos;<br>    radius = _r;<br>    startAngle = _startAngle;<br>    endAngle = _endAngle;<br><br>    start = new PVector(<br>      center.x + cos(startAngle) * radius,<br>      center.y + sin(startAngle) * radius<br>    );<br><br>    end = new PVector(<br>      center.x + cos(endAngle) * radius,<br>      center.y + sin(endAngle) * radius<br>    );<br><br>  }<br><br>  void style () { ... }<br>  void draw () { ... }<br>  void guides () { ... }<br><br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vFHeaCU3HudthWArqcGy-Q.png" /><figcaption><em>Visualisation of the arc class and its properties</em></figcaption></figure><p>Next I created a Walker class that uses the Arc class and actually handles the walking functionality. This class starts with generating an initial arc. Then it generates the next step based on the previous (arc) step. The calculation of finding the next arc looks something like below:</p><pre>Arc calculateNextArc (Arc _prevArc) {<br><br>  // Define properties for new arc<br>  float newRadius = random(minRadius, maxRadius);<br>  float angleChange = random(minAngle, maxAngle);<br><br>  // Direction from center to end<br>  PVector dir = PVector.sub(_prevArc.end, _prevArc.center);<br>  dir.setMag(newRadius);<br>  <br>  // Possible left or right arc center points<br>  PVector left, right;<br><br>  if (_arc.clockwise) {<br>    // CLOCKWISE<br>    left = PVector.add(_prevArc.end, dir);<br>    right = PVector.sub(_prevArc.end, dir);<br><br>    if (random(1) &gt; 0.5) {<br>      // Rotate left (counter clockwise)<br>      float angle = _prevArc.endAngle + PI;<br>      return new Arc(left, newRadius, angle, angle - angleChange);<br>    } else {<br>      // Rotate right (clockwise)<br>      float angle = _prevArc.endAngle;<br>      return new Arc(right, newRadius, angle, angle + angleChange);<br>    }<br>  } else {<br>    // COUNTER CLOCKWISE<br>    // If counter clockwise we need to flip the starting angle for left and right<br>    left = PVector.sub(_prevArc.end, dir);<br>    right = PVector.add(_prevArc.end, dir);<br>    <br>    if (random(1) &gt; 0.5) {<br>      // Rotate left (counter clockwise)<br>      float angle = _prevArc.endAngle;<br>      return new Arc(left, newRadius, angle, angle - angleChange);<br>    } else {<br>      // Rotate right (clockwise)<br>      float angle = _prevArc.endAngle + PI;<br>      return new Arc(right, newRadius, angle, angle + angleChange);<br>    }<br>  }<br>}</pre><p>The ‘calculateNextArc’ function receives the last generated arc. It reads info about the arc’s location, radius, angles and if its drawn clockwise or not. Then it calculates possible left or right center points for the new arc. It uses some vector math combined with several if statements. If you want to know more about vector math check out the previously mentioned <a href="https://natureofcode.com/book/chapter-1-vectors/">The Nature of Code</a> by Daniel Shiffman. Lastly the function tosses a coin to decide if the walker will turn left or right and create the next arc. Repeat this function a couple of times and you get a random walker graphic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*247efFpCqPsWiFjYsIGG9w.png" /><figcaption><em>First results of a random walker with arc paths</em></figcaption></figure><h3>Keep it contained</h3><p>I didn’t like that I had little control over the direction of the random walker and that it could leave the canvas bounds. To address this, I wanted to hold the random walker inside a rectangular container. My first approach was to have the random walker always walk towards a target point, which would change over time and stay within the given boundary. However, the downside of this approach was that the walker could still get out of bounds when its radius was larger than its distance to the closest edge of the canvas. Thus, I decided to pursue another path…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*RjmxVmfyCnr9Fol4HAH3vw.gif" /><figcaption><em>Walker that moves towards a random target point</em></figcaption></figure><h3>More checks</h3><p>I had to make the algorithm smarter, so I introduced more checks. I created four direction guides (forward, backward, left, and right) coming out of the end point of the previous arc. For each direction, I adjusted its length when it hit the rectangular boundary, giving me more control over choosing a left or right arc and specifying a radius that wouldn’t extend the boundary. Additionally, because I already had a forward direction, I could calculate angles towards the intersecting edge to see if there was more space on the left or right side of the direction. Combining these methods, plus a few more checks, helped me create a random walker that stayed inside a rectangular boundary. Looking back, I implemented something that looks like Raycasting. I plan to look into that some day.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*PI1Qp1b8Ux7I0eZjcw1j1w.gif" /><figcaption>Warcler debug view including directional guides, distances towards edges, angles &amp; radii</figcaption></figure><h3>Testing the algorithm</h3><p>I sell personalized outputs of my algorithms as fine art prints. You can feed the algorithm your personal input and it will generate an edition specifically for you. The input can be anything as long as it is text-based. Think of a special date, a birthday, a coordinate, or the name of your pet — you name it ;) Before I release my algorithms on my <a href="https://www.misha.studio/shop">webshop</a>, I test them with various inputs. In the past, I used random numbers for this, but they don’t have much significance since they’re random.</p><p>During the Warcler project, I created a small library with all kinds of interesting inputs that I could use for testing. For this, I asked a conversational AI to generate lists of coordinates of places, famous people, pet names, and so on. When testing, I feed these inputs to the algorithm, and the outputs immediately take on special meaning because they are tied to, for example, a famous person like Shakespeare.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qA-q2cY4Lri1B6hYu2nO1Q.jpeg" /></figure><h3>Adding motion</h3><p>To inform the public about my art, I like to make social posts of mockups, behind-the-scenes shots, and animations. Generative design/art is great because it can be influenced as it is drawn to the screen. Instead of drawing the graphic all at once, I can draw parts of it frame-by-frame, creating an animation. I used this technique for the Warcler algorithm in some social posts, and I plan to do this more often as it brings my work to life.</p><h3>Misha.studio on Twitter: &quot;Watch how my Warcler algorithm draws one of a kind editions based on various textual inputs. Get your edition based on your input →https://t.co/V5CMTCWtfk#generativeart #fineartprints pic.twitter.com/DtbSWYAotN / Twitter&quot;</h3><p>Watch how my Warcler algorithm draws one of a kind editions based on various textual inputs. Get your edition based on your input →https://t.co/V5CMTCWtfk#generativeart #fineartprints pic.twitter.com/DtbSWYAotN</p><h3>Finishing thoughts</h3><p>The cool thing about this algorithm is that I got it working pretty fast but that I spent a lot of time trying to keep the scribble contained within a boundary. I learned that when a page of code becomes very long and complex, it’s best to split it up into separate parts. From now on when I’m working with classes, I try to keep them as focused as possible, and if I need new functionality, I create a new class for that.</p><p>I hope you’ve learned something about the work that gets into the artwork. If you have any questions or remarks please let me know via socials or DM ;)</p><p><a href="https://www.misha.studio/shop/algorithms/warcler/">Get your personalised edition</a> of the Warcler algorithm via my shop. Cheers!</p><p><em>Originally published at </em><a href="https://www.misha.studio/blog/generating-a-scribble/"><em>https://www.misha.studio/blog/generating-a-scribble/</em></a><em> on January 28, 2023.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2bb7c93e329c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating grainy gradients — Behind the algorithm: Granular]]></title>
            <link>https://medium.com/@misha.studio/creating-grainy-gradients-behind-the-algorithm-granular-a00c33596273?source=rss-c59c4dc45014------2</link>
            <guid isPermaLink="false">https://medium.com/p/a00c33596273</guid>
            <category><![CDATA[design]]></category>
            <category><![CDATA[art]]></category>
            <category><![CDATA[generative-art]]></category>
            <category><![CDATA[creative-coding]]></category>
            <category><![CDATA[graphic-design]]></category>
            <dc:creator><![CDATA[Misha.studio]]></dc:creator>
            <pubDate>Fri, 07 Oct 2022 00:00:19 GMT</pubDate>
            <atom:updated>2023-01-29T18:57:42.262Z</atom:updated>
            <content:encoded><![CDATA[<h3>Creating grainy gradients — Behind the algorithm: Granular</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*43SnjS64UkSNZ77Y-culTg.png" /></figure><p>Most of my art is a result of me experimenting with new techniques. For my latest piece — <a href="https://www.misha.studio/shop/algorithms/granular-c">Granular C</a> — I was figuring out how I could make my art feel like it wasn’t created by a computer anymore. In this post I explain how I created the grainy rendering technique used in Granular C.</p><h3>The spark</h3><p>It all started when I saw the work <a href="https://www.artblocks.io/collections/curated/projects/0xa7d8d9ef8d8ce8992df33d8b8cf4aebabd5bd270/255/tokens/255000000">Screens</a> of <a href="https://twitter.com/thomasp85">Thomas Lin Pedersen</a>. In particular my eye fell on the grainy way the gradients were rendered. On his website Thomas mentions that he focused on a gradient rendering technique of mimicking screen printing. I really liked the look and feel of it and wanted to master this technique so I could use it for my own art.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*opupAF8IEx6eOiYNNFBrmg.png" /><figcaption><em>Screens #0 by Thomas Lin Pedersen (Zoom on the gradient rendering)</em></figcaption></figure><h3>Analysis</h3><p>I started with studying the gradients up close to see how I could recreate it and noticed two things:</p><ul><li>The gradient existed out of many random points (possibly generated with noise)</li><li>The closer a ‘random’ point is to the lighter area of the gradient the smaller the chance of displaying the point and also its size seems to be decreasing.</li></ul><p>I came up with a plan to first generate a normal gradient. Then I would generate a bunch of uniformly distributed random points within the gradient’s bounds. For each random point’s location I’d check the gradient equivalent color pixel and read its brightness value. Depending on its brightness I’d decide the size of the point and the chance of it being actually drawn to the screen.</p><p>Let’s start coding in <a href="https://processing.org/">Processing Java</a>.</p><blockquote><em>When I was doing some more research for this post I came across the </em><a href="https://www.data-imaginist.com/screens/"><em>webpage</em></a><em> of Screens where Thomas actually explains more about the various techniques used for this piece. You need to scroll down a bit to get to know more about the details. Be sure to check </em><a href="https://www.data-imaginist.com/screens/"><em>this page</em></a><em> out — a lot of cool stuff over there!</em></blockquote><h3>Step 1: Generating a gradient</h3><p>Generating a linear gradient in Processing can be done with the <a href="https://processing.org/examples/lineargradient.html">lerpColor()</a> function but in this case I used a library called <a href="https://github.com/micycle1/PeasyGradients">PeasyGradients</a> by <a href="https://github.com/micycle1">Michael Carlton</a>. The library isn’t officially released yet but you can grab a release on Github. PeasyGradients saves you the trouble of creating your own gradients via pixel manipulation or drawing calls and also provides you with a lot of extra functionalities like types of gradients and interpolation modes. Creating a gradient goes as follows:</p><pre>// Import library<br>import micycle.peasygradients.*;<br>import micycle.peasygradients.gradient.*;<br><br>void setup () {<br> size(320, 320);<br> colorMode(HSB, 360, 100, 100, 100);<br><br> // Initialize library<br> PeasyGradients peasyGradients = new PeasyGradients(this);<br><br> // Create a gradient object<br> Gradient gradient = new Gradient(#000000, #ffffff);<br><br> // Create a PGraphics container<br> PGraphics gradientFill = createGraphics(320, 320);<br><br> // Draw the Gradient onto the PGraphics<br> peasyGradients.setRenderTarget(gradientFill);<br> peasyGradients.linearGradient(<br>  gradient,<br>  HALF_PI<br> );<br> <br> // 5. Draw the gradient to the screen<br> background(#ffffff);<br> image(gradientFill, 0, 0);<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tC05f73_HuLdU81MjFn6DQ.png" /><figcaption><em>A linear, radial and conical gradient generated with PeasyGradients</em></figcaption></figure><blockquote><em>Like mentioned before the library isn’t officially released yet and sometimes it could give some unexpected results. If you come across a bug you can create an issue on </em><a href="https://github.com/micycle1/PeasyGradients"><em>PeasyGradients’ Github page</em></a><em> and you’ll help Michael to improve the library ;)</em></blockquote><h3>Step 2: Creating random points</h3><p>Next I need to create random points within the area of the gradient. You could use Processing’s random() or noise() functions but since I wanted to generate a lot of points I thought of trying something more quicker — the <a href="https://en.wikipedia.org/wiki/Halton_sequence">Halton sequence</a>. A quasi-random number sequence which can give you uniformly distributed points pretty fast. I can’t wrap my head around how this functions works but more info about it over <a href="https://en.wikipedia.org/wiki/Halton_sequence">here</a> ;).</p><pre>float halton(int _index, float _base) {<br>  float result = 0;<br>  float f = 1 / _base;<br>  int i = _index;<br><br>  while (i &gt; 0) {<br>    result = result + f * (i % _base);<br>    i = floor(i / _base);<br>    f = f / _base;<br>  }<br><br>  return result;<br>};</pre><p>To actually create points (x and y) within an area I created the following function where I pass the PGraphics of the gradient so I could get its dimensions. A density variable influences the amount of points to generate.</p><pre>void drawPoints (PGraphics _input) {<br> <br>  float density = 0.5; // influences amount of points<br><br>  // Get dimensions<br>  int w = _input.width;<br>  int h = _input.height;<br><br>  // Calculate the amount of points to generate (area)<br>  int area = round( (w * density) * (h * density) );<br><br>  for (int i = 0; i &lt; area; i++) {<br>    // Use the Halton sequence (0 - 1) with a differennt base for x and y<br>    float x = halton(i, 2) * w;<br>    float y = halton(i, 3) * h;<br><br>    // Draw point<br>    noStroke();<br>    fill(0, 0, 0);<br>    ellipse(x, y, 2, 2);<br>  }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6pjHHHegl4gBcDyKsGT8ng.png" /><figcaption><em>Points created by using the Halton sequence at various densities</em></figcaption></figure><p>In the picture above you can see that the Halton sequence isn’t truly random I have a fix for that in the next step.</p><h3>Step 3: Convert to grain</h3><p>The last step is to use the gradient of step one to influence the drawing of random points of step two. For each possible point we want to check the corresponding gradient’s pixel brightness. The brightness will influence the size and chance of the point being drawn. Points on the lightest side of the gradient should have a tiny chance of being drawn and must be very small. Points on the other end would get a larger chance of being drawn and also have a bigger size.</p><p>See the code below where I’ve added the functionality and put some comments to explain things.</p><pre>void convertToGrain (PGraphics _pg) { <br>  <br>  float dotSize = 4; // influences max size of dots<br>  float density = 1; // influences amount of points<br>  float threshold = 0;<br>  <br>  // Get dimensions<br>  int w = _pg.width;<br>  int h = _pg.height;<br><br>  // Calculate the amount of points to generate (area)<br>  int area = round( (w * density) * (h * density) );<br><br>  // Loop over area<br>  for (int i = 0; i &lt; area; i++) {<br><br>    float x = halton(i, 2) * w;<br>    float y = halton(i, 3) * h;<br>    <br>    // Read color data<br>    color c = _pg.get( floor(x), floor(y) );<br><br>    // Continue loop if the pixel&#39;s alpha = 0<br>    float alpha = alpha(c);<br>    if (alpha == 0) continue;<br><br>    // Based on brightness draw specks<br>    float b = brightness(c) / 100; // I use colorMode(HSB, 360, 100, 100);<br>    b = map(b, 0, 1.0, 0, 1.0 - threshold);<br>    <br>    // Adjust size based on brightness<br>    float offsetSize = dotSize * (1.0 - b);<br>    <br>    // Pick a random number and check against brightness<br>    if (random(1) &gt;= b) {<br>      speck(x, y, (offsetSize / 2)); // random polygon<br>    }<br>  }<br>}</pre><blockquote><em>Note: </em>In my project I actually don’t draw a point or an ellipse but I generate a what I call a ‘speck’ which is just a random polygon.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z3xkw-h2ta-j7K99AWXbXw.png" /><figcaption><em>Grainy rendering of various gradients</em></figcaption></figure><h3>Algorithm: Granular C</h3><p>Combining this grainy rendering technique with another experiment where I created Mondrian inspired grids resulted in a new algorithm — <a href="https://www.misha.studio/shop/algorithms/granular-c">Granular C</a>. In the nearby future I also want to launch a black and white variant hence the letter C (Color). You can get your personal edition of Granular C as a fine art print <a href="https://www.misha.studio/shop/algorithms/granular-c">via my shop</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*62pPBvL9xI53n2bq8bjhjA.png" /><figcaption><em>Various editions of the algorithm: Granular C</em></figcaption></figure><h3>Closing thoughts</h3><p>Looking back at my algorithm I’d probably didn’t need to generate a gradient and read its pixel data. Since I’m drawing linear gradients with straight angles I could use the x or y value to replace the reading of pixel brightness. But since it now works for other types of gradients as well I can re-use and adapt this code for future projects.</p><p>I hope this post gave you some insight in how I create my artwork. If you have any questions or remarks please let me know via e-mail or via DM ;)</p><p><em>Originally published at </em><a href="https://www.misha.studio/blog/creating-grainy-gradients/"><em>https://www.misha.studio/blog/creating-grainy-gradients/</em></a><em> on October 1, 2022.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a00c33596273" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Generative typography — Behind the algorithm: Mexico]]></title>
            <link>https://medium.com/@misha.studio/generative-typography-behind-the-algorithm-mexico-433aeead88b7?source=rss-c59c4dc45014------2</link>
            <guid isPermaLink="false">https://medium.com/p/433aeead88b7</guid>
            <category><![CDATA[graphic-design]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[creative-coding]]></category>
            <category><![CDATA[processing]]></category>
            <category><![CDATA[generative-art]]></category>
            <dc:creator><![CDATA[Misha.studio]]></dc:creator>
            <pubDate>Mon, 05 Sep 2022 00:00:51 GMT</pubDate>
            <atom:updated>2023-01-29T18:47:36.722Z</atom:updated>
            <content:encoded><![CDATA[<h3>Generative typography — Behind the algorithm: Mexico</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kSa2zkixXORqNR0KxkJ4gA.png" /></figure><p>As a Digital Designer at IN10 I’m blessed to work with various established visual identities. One of those is the visual identity of the Museum Boijmans van Beuningen. This visual identity is designed by Armand Mevis and Linda Van Deursen and is heavily inspired by the typeface of the Mexico Olympics of 1986 (designed by Lance Wyman).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PofzeBupkbvMAygnzmfcOA.png" /><figcaption><em>Mexico Olympics Typeface by Lance Wyman, 1966</em></figcaption></figure><p>The Mexico Olympics typeface is based on the geometry of the Olympic rings and inspired by multiline patterns found in Mexican art. I really liked how this typeface was constructed. With a quick glance you can see that most characters are drawn with just a few geometric shapes. I gave myself a challenge to see if I could recreate this typeface by using code and iterate on its design from there.</p><h3>Deconstruct</h3><p>Before I could start programming I deconstructed the Mexico Olympics typeface. Looking at the characters I noticed that most characters could be drawn with arcs, corners and lines. Grid wise it seemed that most characters used a 2x4 grid of tiles where each tile could hold one of the graphics described previously. A couple of ‘special’ characters like the M, W, Z &amp; V needed another approach because these characters used different shapes and grids. I started with the basics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AFm8gjQMpfjVnV8yhwA7bA.png" /><figcaption><em>Base graphical elements for the construction of most of the characters</em></figcaption></figure><h3>Drawing characters</h3><p>Knowing how I could draw most characters it was time to start programming. I started with making the graphical elements. Each character uses its own set of graphical elements. The letter A for example uses two opposing arcs that form a half circle at the top two columns, two straight corners on the second row of columns and four straight lines for the last two rows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TX0E24xvw3jsJ_et.gif" /></figure><p>Pretty quickly I could generate characters but it was a tedious job to create a custom drawing function for each characters. To fix this I created a command string for each character that held instructions for choosing the type of graphics, the orientation and a possible overshoot (some letters needed to have an extra length at the end of their graphical shapes). The command strings looked something like this:</p><pre>String characterA = &quot;ATL,ATR,TBL,E,E,TTR,LLEOE,LREOS&quot;;<br>String characterB = &quot;CTL,ATR,TBL,E,E,DTR,CBL,ABR&quot;;<br>String characterC = &quot;ATL,ATR,LLE,E,LLE,E,ABL,ABR&quot;;</pre><p>I wrote an interpreter that could draw a character based on the above command strings. Roughly translated the command string for the character A says:</p><ul><li>ATL = Type: Arc / Orientation: Top Left</li><li>ATR = Type: Arc / Orientation: Top Right</li><li>TBL = Type: T-Junction / Orientation: Bottom Left</li><li>E = Empty</li><li>E = Empty</li><li>TTR = Type: T-Junction / Orientation: Top Right</li><li>LLEOE = Type: Line / Orientation: Left / Overshot: Overshoot End</li><li>LREOS = Type: Line / Orientation: Right / Overshoot: Overshoot Start</li></ul><p>With this approach I immediately sped up my proces so I could focus on iterating further on its design. For ‘special’ characters like the M, W, Z and V I came up with a similar but more custom approach.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xnoTOzQc8W0_F87xdJ_l3w.png" /><figcaption><em>Generated characters: A, B &amp; C</em></figcaption></figure><h3>Iterating / Experimenting</h3><p>Having a basic algorithm for drawing all characters I could start exploring various visual directions. During this process I come up with questions/ideas like:</p><ul><li>What result do you get if characters are drawn with multiple lines instead of the original three?</li><li>What happens if I use different stroke weight?</li><li>What effect do you get when you alter the scaling of the graphic elements?</li></ul><p>I implement these ideas along the way when I’m working on the algorithm. Sometimes I need to alter or add functionality to the algorithm but it could also take only a change in a single parameter. See below for a couple of experiments I did.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oOKMn90cs-JZ_1PEK19sQg.png" /><figcaption><em>Experiment where characters are build with varying line amounts</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4QZfPYn8-EKaOppHF4Nkfw.png" /><figcaption><em>Experiment of characters with different weights</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qN0IfCXfLFlzA7GXB5zwfA.png" /><figcaption><em>Experiment of characters with random stroke weights in many places</em></figcaption></figure><h3>Finishing up</h3><p>After exploring several visual directions I ended up with a variant where each character is generated differently due to the influence of random stroke weights and coloring. This gives an almost 3D or collage like feel to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FF0EN8pekNIjJszS.gif" /></figure><h3>Get your editon</h3><p>Choose your letter or number, add your personal input and <a href="https://www.misha.studio/shop/mexico">get your unique edition</a> of this algorithm via my <a href="https://www.misha.studio/shop/mexico">shop</a>.</p><figure><img alt="Mockup of the letter ‘B’ generated by the algorithm Mexico" src="https://cdn-images-1.medium.com/max/1024/1*Uy1d57fCPahSfoasNOnTUA.jpeg" /></figure><p>I hope this post gave you some insight in how I create my artwork. In this case I started by trying to recreate an existing piece of art / typeface and used that as a basis to create something different with still a resemblance to its inspiration.</p><p>If you have any questions or remarks please let me know via e-mail or via DM ;)</p><p><em>Originally published at </em><a href="https://www.misha.studio/blog/behind-the-algorithm-mexico/"><em>https://www.misha.studio/blog/behind-the-algorithm-mexico/</em></a><em> on September 3, 2022.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=433aeead88b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Process(ing): Generative Irregular Grid]]></title>
            <link>https://medium.com/@misha.studio/process-ing-generative-irregular-grid-8f0d712dfaa4?source=rss-c59c4dc45014------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f0d712dfaa4</guid>
            <category><![CDATA[generative-design]]></category>
            <category><![CDATA[graphic-design]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[creative-process]]></category>
            <category><![CDATA[creative-coding]]></category>
            <dc:creator><![CDATA[Misha.studio]]></dc:creator>
            <pubDate>Wed, 30 May 2018 19:54:14 GMT</pubDate>
            <atom:updated>2023-02-17T07:52:22.292Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hId6Ncop8G1aSYYc9fp80g.png" /></figure><p>A couple of years ago I stumbled on the <a href="http://www.processing.org/">Processing</a> programming language and the wonderful world of Generative Design / Art. I started doing daily experiments, otherwise known as Processing sketches, to become better and posted the results to my Tumblr blog called <a href="http://pttrnz.tumblr.com/">pttrnz.tumblr.com</a>. Just recently I moved to <a href="https://www.instagram.com/misha.studio_/">Instagram</a> for posting my experiments with code (and other design things). I often get asked how I make my sketches. Until now I never so much explained or documented my process of making these things. So let’s start with my process of my latest sketch: Irregular Grid.</p><blockquote>Heads up. In this article I’ll try to give you an overview of my process. I won’t go into too many details in code. This is not a tutorial, but just a glimpse inside of my process. I hope that for those who haven’t played with code a lot these words and code examples still make sense ;)</blockquote><h3>The Spark</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H9QE_Bj6ZwSZ0RP-u9a4XQ.jpeg" /><figcaption>Instagram post by @manoloide</figcaption></figure><p>A couple of weeks ago I stumbled on the works of @<a href="https://www.instagram.com/manoloide/">manoloide</a>, a creative coder and generative designer from Argentina. In one of his works (see above) he uses a simple grid of squares (which held shapes) where some squares subdivided themselves one or more times into smaller parts. I loved the simplicity but also the complexity of the effect this technique creates. This was the trigger for me to start exploring this grid approach.</p><h3>Setup</h3><p>Processing comes with a native code editor but I like to use Sublime Text 3 for writing and building my sketches because it has some nice features that speeds up my process. I always start of with my custom default project, I call this project my Starting point. This is just a simple Processing sketch with my default settings and some export functionalities. I really can recommend making your own starting project with your own defaults and functionalities instead of always typing the same things over and over again when you start a new project.</p><h3>Name your project</h3><p>After duplicating my starting point I rename my sketch to something that lets me easily find it back and gives me some sense of what the project is all about. This one was called “20180512 Irregular Grid”, pretty straightforward. Starting off with a date to keep some structure in my folders and a name that explains the sketch. It’s hard to describe your project in one or two words and over the years you get some funky ones like <a href="http://pttrnz.tumblr.com/image/130059517181">Perkelgraph</a>, <a href="http://pttrnz.tumblr.com/image/129405882959">Blobby</a>, <a href="http://pttrnz.tumblr.com/image/141563327859">Circles_no_overlap</a>, <a href="https://www.instagram.com/p/BamloE5hJnF/?taken-by=misha.studio_">Bezier Flower</a>, <a href="http://pttrnz.tumblr.com/image/129490577419">Blended_Blob</a>, and many more ;)</p><h3>Start</h3><p>Alright the Irregular Grid, not even sure this is the proper title but who cares. Let’s start coding. I already had some idea of how I would like to approach this. I like to work with objects/classes so I immediately started with making two classes:</p><p><strong>GridPoint class</strong><br>A simple class that holds an x, y position and a width and a height which represents one single tile within the grid.</p><p><strong>IrregularGrid class</strong><br>A class that initiates and holds the points/tiles based on a given amount of rows/columns and width and height.</p><p>Then I start coding an initial regular grid with two for-loops. This looks something like this:</p><pre>// Initialize<br>ArrayList&lt;GridPoint&gt; points = new ArrayList&lt;GridPoint&gt;();<br>float tileWidth, tileHeight = 100;</pre><pre>for (float x = 0; x &lt;= width; x += tileWidth) {<br>  for (float y = 0; y &lt;= height; y += tileHeight) {<br>    points.add(<br>      new GridPoint(x, y, tileWidth, tileHeight)<br>   );<br>  }<br>}</pre><pre>// Insert draw functions</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ABesAZZ1-AmcPHPwexX9aw.png" /><figcaption>A regular grid of grid points</figcaption></figure><p>So I now got a basic grid to work with. To create the effect @manoloide used I added a subdivide method to the GridPoint class that returns four new GridPoints. Then after initiating the IrregularGrid I loop several times over the GridPoints and randomly pick one that gets subdivided.</p><pre>void randomlySubdivideGridPoints () {<br>  ArrayList&lt;GridPoint&gt; newPoints = new ArrayList&lt;GridPoint&gt;();<br>    <br>    for (GridPoint p : points) {<br>      if (random(1) &gt; 0.5) {<br>        p.subdivide(newPoints);<br>      } else {<br>        newPoints.add(p);<br>      }<br>    }</pre><pre>  points = newPoints;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2N4oxtTHJZt0FsPz-6tqjw.png" /><figcaption>First setup of an irregular grid</figcaption></figure><h3>Iterate, iterate, iterate</h3><p>Now I got my basic setup and it’s time to explore what we can do with this type of grid. To keep organised and have some kind of version control I use this cool little method learned from one of my heroes <a href="https://medium.com/u/3a43efa77dd5">Joshua Davis</a>‘ Skillshare classes: <a href="https://www.skillshare.com/classes/Programming-Graphics-I-Introduction-to-Generative-Art/782118657/classroom/discussions?via=search-layout-grid&amp;enrolledRedirect=1">Programming Graphics I: Introduction to Generative Art</a>. It’s very simple, each time when I want to make a new iteration I duplicate my current iteration, change the version number and add a short description about what the iteration is all about. Your folder structure will look something like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UNJuIJH8kXcEgST0s7K0vg.png" /></figure><h3>Iteration #1: Add shapes</h3><p>Now I got my basic setup and it’s time to explore what we can do with this type of grid. I start of with some shapes and by dropping the guidelines. Processing comes with various functions to draw shapes like rect(x, y, width, height), ellipse(x, y, width, height), etcetera… I like to make separate classes for drawing shapes because this gives me more control and functionalities like storing and altering style &amp; rotation data. And by using a Triangle shape which randomly gets rotated by 90 degrees you’ll get something like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EvBVvLLJ4ZcHOc6zDFepug.png" /></figure><h3>Iteration #2: Add multiple shapes</h3><p>It looks cool with some Triangle shapes. But how would it look with multiple shapes? I threw some other shapes into the mix and you’ll get something like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hXzV--SM7z2JZESzDtBbuw.gif" /></figure><p>These shapes are relatively easy to generate. For the round target like shape I just loop and draw ellipses a couple of times by using the native ellipse(x, y, width, height) function. For the layered triangle I use the beginShape() and endShape() function.</p><pre>void drawGraphic () {<br>  for (int i = 0; i &lt;= numberOfCopies; i++) {<br>    // Simple way of setting alternate colors<br>    if (i % 2 == 0) {<br>      fill(0, 0, 100);          <br>    } else {<br>      fill(200, 20, 5);<br>    }</pre><pre>// Calculate size and draw triangle<br>    float halfSize = map(i, 0, numberOfCopies, size / 2, 0);<br>    beginShape();<br>     vertex(-halfSize, -halfSize);<br>     vertex(halfSize, halfSize);<br>     vertex(halfSize, -halfSize);<br>    endShape();<br>  }<br>}</pre><h3>Iteration #3: Different width &amp; height for grid tiles</h3><p>Until now each tile in the grid is a perfect square. How would it look if the tiles had a different width and height. I needed to do some reshaping of the code because all my files used one variable called tileSize. I split this up in tileWidth and tileHeight and then you get this. If you look closely below there is one frame with a bug where the tiles don’t align. Often times these little errors create some nice effects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N0loc9iUBIoZ6YjQnngDLw.gif" /></figure><h3>Iteration #4: Stacking</h3><p>What happens if you stack multiple irregular grids of different shapes on top of each other? I like to create a Layer class which holds a grid and the shapes so I can change parameters per layer and easily call draw functions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0zwVqHRqaLgebMWl4QrMRw.gif" /></figure><h3>Iteration #5: Mirror</h3><p>Something I often try when I’m playing with randomness and shapes is to try to put some symmetry in the randomness. I do this by using the handy popMatrix()/pushMatrix() and the translate()/scale() functions. It’s difficult to explain what these functions do so if you’re interested you should look into those. It basically let’s you draw shapes within a given transformation (scale, rotation, translate) without effecting other shape drawing functions. The code could look something like this:</p><pre> // Top left<br> pushMatrix();<br> scale(0.5);<br> layerOne.display();<br> popMatrix();</pre><pre> // Top right<br> pushMatrix();<br> translate(width, 0);<br> scale(-0.5, 0.5);<br> layerOne.display();<br> popMatrix();</pre><pre> // Bottom right<br> pushMatrix();<br> translate(width, height);<br> scale(-0.5, -0.5);<br> layerOne.display();<br> popMatrix();</pre><pre> // Bottom left<br> pushMatrix();<br> translate(0, height);<br> scale(0.5, -0.5);<br> layerOne.display();<br> popMatrix();</pre><p>And then you’ll get something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W8SVeHWryXjj9VWBF4RtjA.gif" /></figure><p>It reminds me of some Aztek kind of style I guess. Looks cool! Press “s” to save a .png or .pdf and continue exploring.</p><h3>Iteraton #6: Color</h3><p>I like start with black and white but sometimes you have to experiment with some colors. I like to use <a href="http://coolors.co/app">Coolors.co</a> or <a href="http://colorhunt.co/">Colorhunt</a> to get some nice color palettes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DD9tGs5NNLuVNFtZgjjwDw.gif" /></figure><h3>Iteration #7: Gradients</h3><p>Gradients are a bit tricky in Processing because there isn’t a gradient fill method. To create a gradient effect you need to draw several shapes on top of each other whereby the color lerps over time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d8SFHYqKluMNB5O5V0EKMQ.gif" /></figure><h3>Last words</h3><p>This was a short glimpse of my process. I’d say, just share your art, trigger new ideas, iterate, iterate, and repeat.</p><p>This was my first article about my process of iteration. I hope you liked it and learned something new. I’d love to know what you thought about this article, if this is something you want to read more or if there are things you would like to read about. Just hit me up in the comments or via <a href="https://www.instagram.com/misha.studio_/">Instagram</a> / <a href="https://twitter.com/misha_studio_">Twitter</a>.</p><p><strong>Shop</strong> — Since 2022 I sell some of my work via <a href="http://www.misha.studio/shop">www.misha.studio/shop</a> where you get one of a kind artworks based on your personal input.</p><p><strong>Blog</strong> — I also started a blog on <a href="http://www.misha.studio/blog">www.misha.studio/blog</a> where I try to post regularly about the work that gets into making generative art.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f0d712dfaa4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>