# Color Vector Rotations (v1.2, updated: 6 Nov 2023)

## Recommended Posts

Effects->Color->Vector Rotation (Axis-Angle)

Effects->Color->Vector Rotation (Euler)

Effects->Color->Vector Cross Product

Description:

I've been geeking about quaternions and color space conversions recently, which led me to wonder what happens if you interpret one image's pixels as 3-dimensional vectors and another image's as quaternions, then rotate the first one's pixels.

There's three methods available:

• Axis-angle representation - each color determines a 3D axis, and its intensity or alpha the angle.
• Euler angles - each color component determines amount of rotation around each of the 3D axes.
• Vector cross product - each color determines a second vector and does a cross product (straight quaternion multiplication).

First two produce similar effects but are mathematically different, with axis-angle being the "less messy" option. Cross product generally turns things black or does crazy things, with little chill.

Some demo images: a picture of northern lights with a simple horizontal gradient used for rotation, with an embedded kitty with a radial gradient. You're of course not restricted to gradients, but too detailed images might get quite intense. The second last image is just 2 applications of the angle filters on a horizontal blue-magenta-red gradient+black-white gradient. Finally, a comparison of all the filters in the bundle on the same photo.

Settings, axis-angle & Euler:

• Rotation source layer: can be either the current layer, the layer above, or layer below. If the layer doesn't exist, there's no effect. Euler works better with a single layer than axis-angle, so the latter defaults to below instead of current.
• Target vector offset: changes the zero value that's used to interpret the target layer's colors into vectors. For example, offset 0 means RGB 255, 127, 0 is interpreted as the same vector, but offset 127 means it's taken as 128, 0, -127 instead.
• Rotation vector offset: same as above, but for the rotation angles/axis. Works kind of like a hue adjustment, and loops around at the extremes.
• Angle multiplier: by default a value of 255 on the rotation layer is interpreted as one full rotation (which means it has no effect), but the multiplier changes the number of cycles per 255 units.
• (Euler style) Rotation order: when doing 3D Euler rotations the order matters, so you can choose the order the color channels' rotations are applied. Pick the one that looks the nicest.
• (Axis-angle style) Source alpha as angle: by default the rotation angle is taken as the maximum value of the RGB components, but alpha on the rotation source layer can be used instead.
• Negative values as inverse color: rotations can make the color components negative and by default the absolute value is used, i.e. -255 G would be taken as +255 G. When this setting is enabled, -255 G will instead become +255 R, +255 B.

Cross product:

• Second vector layer: either the layer below or above, since the cross product of anything by itself is black and that's boring.
• Intensity scaling: cross product has a hard time doing "subtle", so the intensity can be scaled to source image intensity or so that the highest RGB component is maxed out.
• Negative values as inverse color: same as angle styles.

Notes:

• The tool uses a limited layer picker because the built in one in CodeLab often gets stuck if working on multiple documents or the number of layers changes.
• With axis-angle you're likely to need 2 layers to get good effects: rotating a vector around itself does nothing (point a finger forward, turn your hand upside down around the finger's axis: the finger still points forward) and the other adjustments help only so much.
• As mentioned above, cross product requires 2 layers: there're no logical adjustments I can think of to make it work with just a single layer without producing all black pixels.
• Try combining the effects with a slightly altered duplicate of the same layer, e.g. duplicate, do a zoom blur and then color rotate.

Version History:

V1.2:

• Added cross product, even if it's arguably not quite the same thing as a true rotation.
• Fixed an error in the negative values as inverse colors -setting: the negative value was never zeroed out properly.

V1.1:

• Renamed the first effect to Vector Rotation (Euler), added the Axis-Angle variant.
• Added the negative values as inverse colors -setting.

Edited by frio
version 1.2, added a variant
• 2
• 1
• 3
##### Share on other sites

Like....Wow, Man. This is freaky

##### Share on other sites

• frio changed the title to Color Vector Rotations (v1.1, updated: 05-11-2023)

Immediate 1.1 update since I had a shower thought that I could use axis-angle representation as well and take color intensity as the angle. It's maybe even more fun, since they're not janky like Euler angles!

• 1
• 1
##### Share on other sites

Took me a bit to figure out how to use this, but as EER says:

On 11/3/2023 at 11:52 PM, Ego Eram Reputo said:

Like....Wow, Man. This is freaky

Good job @frio!  😊👍

• 3
• 1

"Never, ever lose your sense of humor - you'll live longer"

##### Share on other sites

Oddly enough, this reminds me of Red ochre’s Psychocolour plug-in (I solemnly apologize for the unwanted comparison), which consists of one slider.

All comparisons aside, I might need to try this out. You know I love everything of the psychedelic genre

##### Share on other sites

Another quick update to 1.2, now I think I'm done with this train of thought. A good learning experience, now if I get other (maybe less abstract) filter ideas I can give them a go in CodeLab.

Changes: fixed an error in the "negatives as inverse" option and added the final simple vector combination that I can think of, cross product (= direct quaternion multiplication discarding the scalar part). Arguably not really a rotation but still similar enough, go easy on me about terminology. 😛

13 hours ago, BlastOfBN said:

this reminds me of Red ochre’s Psychocolour plug-in

Wasn't familiar with that one but it does appear to have potential for similar results. These are really quite abstract, but the axis-angle one has maybe the most potential: duplicate a layer, do some kind of small adjustment on the bottom copy like a blur, then run the axis-angle rotation on the top layer. Makes for some groovy psychedelic auras around things.

##### Share on other sites

• frio changed the title to Color Vector Rotations (v1.2, updated: 6 Nov 2023)
2 hours ago, frio said:

Wasn't familiar with that one but it does appear to have potential for similar results

Yeah, it doesn’t seem that anyone is familiar with this one:

Not even some of the moderators know about this plugin.

##### Share on other sites

On 11/7/2023 at 6:30 AM, BlastOfBN said:

Not even some of the moderators know about this plugin.

I doubt this is true. Why do you say that?

I even know why it is called Psychocolor....

##### Share on other sites

12 minutes ago, Ego Eram Reputo said:

I doubt this is true. Why do you say that?

I primarily brought this up considering how whenever it was mentioned (primarily out of context or randomly), not many people were aware of it, including a moderator, whose identity won’t be revealed for this, as I don’t want to start any harassment or ill wills.

##### Share on other sites

I use it when I'm looking for color variations.  👍

"Never, ever lose your sense of humor - you'll live longer"

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×