Note: This is a follow-up post to my post on creating psychedelic animations using trigonometry.

In my last post, I accounted for a method for creating psychedelic animations based on simple trigonometry. In this post, I’ll expand upon that method using the HSV color scheme rather than the traditional RGB color scheme.

The problem with the old method with using RGB was that each of the color channels were too easily distinguishable from each other. If you recall some of the old gifs:

Although this gif can easily be called psychedelic, it’s far too easy to distuingish the red stripes – the colors don’t blend very well, so I thought to use HSV (hue, saturation, value) to determine the colors. I’ll use the same method by having three functions H(x,y,z), S(x,y,z), V(x,y,z) but using HSV instead of RGB, my hypothesis is that this’ll create far better looking gifs.

I’m using the conversion algorithm found on the wikipedia page for HSV to convert HSV to RGB, which allows me to place the pixels on an image in Java:

In the last post, I had to manually discover fun-looking functions, however this time around, I decided to implement the random cosine waves used in my post on smooth curves and games, because I theorized that random cosine waves were better at creating fun-looking functions than myself.

The first .gif I created with this method was the following (which happens to be a perfect loop):