Code Monkey home page Code Monkey logo

rotational-growth's Introduction

Turning into Turing, A Rotational Growth Photoshop® Script

How did this, become this, become that?

Did you know that if you repeatedly rotate an image in Photoshop®, it eventually breaks down and may produce a Turing pattern that animates differential growth?

The start: HSB gradient (hue = 0–360, s = 100, b = 100), 361 × 2 px

rainbow gradient start

And then: the above image rotated by 2 degrees, 360 times (a.k.a 2 full revolutions)

rainbow gradient rotated 2 degrees, 360 times (2 revolutions) using bicubicSharper interpolation

But THEN: the start image rotated by 2 degrees, 10800 times (a.k.a 60 full revolutions)

rainbow gradient rotated 2 degrees, 10'800 times (60 revolutions) using bicubicSharper interpolation

It may be hard to believe, but the only thing I did was rotate the first image thousands of times. See it as an animation:

animatioin of rainbow gradient rotated 2 degrees, 10'800 times (60 revolutions) using bicubicSharper interpolation


How to

The jsx file will only work in Photoshop®.

It’s generally good to have a canvas that’s bigger than the image you want to alter, but you can always change that later too. You’ll also probably want to save the file as Large Document Format (.psb) before you begin as the file size gets real big, real fast.

  • Select a layer to apply the script to.
  • Go to File menu, choose Scripts, then Browse… and select the rotational_growth.jsx file
  • You will be prompted to input the settings you would like to use:
    • Interpolation method. The first three produce Turing patterns, the last two don’t
    • Anchor point location. Best to keep in center in most cases
    • Number of steps per rotation, e.g. 72 steps = . Integers only
    • Number of total revolutions. Integers only
    • Number of revolutions to show every frame / iteration. Zero will only show every 360° revolution frame
    • Whether you want it rotate counter-clockwise or not.
  • The window should show you the number of rotation iterations and new lyers that will be created in the file. I'd keep these low until you understand how long the script can take.
  • Sit back and wait 🍸
  • When complete, there will be a frame animation of all the layers.
  • The file will be saved automatically periodically and when complete.

Examples of settings:

Interpolation (2 degrees: 2 revolutions & 60 revolutions):

bicubic

rainbow gradient rotated 2 degrees, 360 times (2 revolutions) using bicubic interpolation

rainbow gradient rotated 2 degrees, 10800 times (60 revolutions) using bicubic interpolation

bicubicSharper

rainbow gradient rotated 2 degrees, 360 times (2 revolutions) using bicubicSharper interpolation

rainbow gradient rotated 2 degrees, 10800 times (60 revolutions) using bicubicSharper interpolation

the best IMHO

bicubicSmoother

rainbow gradient rotated 2 degrees, 360 times (2 revolutions) using bicubicSmoother interpolation

rainbow gradient rotated 2 degrees, 10800 times (60 revolutions) using bicubicSmoother interpolation

bilinear

rainbow gradient rotated 2 degrees, 360 times (2 revolutions) using bilinear interpolation

rainbow gradient rotated 2 degrees, 10800 times (60 revolutions) using bilinear interpolation

nearestNeighbor

rainbow gradient rotated 2 degrees, 360 times (2 revolutions) using nearestNeighbor interpolation

rainbow gradient rotated 2 degrees, 10800 times (60 revolutions) using nearestNeighbor interpolation


Caveats:

  • I haven’t put in any input validation yet, so it may throw unhelpful errors.
  • Rotating by 1, 2, or 4 steps will produce no real results as rotating by 360°, 180°, or 90° are lossless transformations
  • a single pixel, or very small amounts of pixels may not produce any real results
  • large numbers of steps (i.e. very small degrees per step) may also not produce results
  • large numbers of steps will take forever, as will large numbers of revolutions
  • Photoshop will hang, quit, or otherwise be unresponsive. It will hate you.
  • I’m pretty sure if an app / library uses bicubic interpolation, similar results can be had with repeated rotations

Related / Research / etc.:


by JK Keller, dilettante 🔮 coder, use at your own risk 🕳

https://jk-keller.com/o__o/rotational_growth

rotational-growth's People

Contributors

jk-keller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

rotational-growth's Issues

Empty dialog window gets stuck open

not sure what's triggering, but seems for long processing sessions, an empty window persists afterwards that can't be closed without quitting PS

Recenter every revolution?

Some instances (e.g. nearest neighbor interpolation) cause the image to travel outside of the canvas.

Maybe add way to recenter the layer after each revolution or all the layers at the end?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.