What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Cumulative distortion and softening in successive rotations


Tr1plex

Member
Messages
5
Likes
2
I created a spinner animated gif image.
spinner.gif
Though, that's not really the issue.
The way I did it was by duplicating the first layer and applying a 10° rotation.
And again, and again, and again... 36x.
My issue (if you haven't noticed), the first frame is very smooth and rounded.
However, as I progress through the layers I began noticing a distortion in the image.
(Here are first and last frames)
before-after.jpg
My question is, why would it distort with a simple rotation added to each layer?
 

Tom Mann

Guru
Messages
7,223
Likes
4,343
I am driving at the moment, but will be home in a couple of hours. I am pretty sure I know what is going on and will respond then.

Tom
 

IamSam

Administrator
Staff member
Administrator
Messages
22,721
Likes
13,258
This is fairly simple, it's a result of how you duplicated the frames, it's also rotating off center.

Were you duplicating the original layer every time and then applying the rotation?

Or were you duplicating the previously duplicated and rotated image and then rotating it again?



This is how it should look. I used the video timeline with transform keyframes and not frame animation.

SpinningGIF_01.gif
 
Last edited:

IamSam

Administrator
Staff member
Administrator
Messages
22,721
Likes
13,258
The distortion and movement begins in frame three (3)

This is your frame one (1)

Screen Shot 2015-10-04 at 6.23.48 PM.png

This is frame eighteen (18)...
Screen Shot 2015-10-04 at 6.24.57 PM.png

It has moved to the right.
 
Last edited:

Tr1plex

Member
Messages
5
Likes
2
@ IamSam -
Were you duplicating the original layer every time and then applying the rotation?
It was a series of: ctrt+J (copy layer), ctrl+shift+T (Transform again). While this is how I ended up with an exponentially worse composite, I'm still not sure why it ended in that result.

It has moved to the right.
Technically, it should have been dead center. That being said... stranger things have happened I guess. :redface:
 

Paul

Former Member
Messages
12,879
Likes
7,023
SpinningGIF_01.gif New layer above top animation frame, quick edit mask option with brush slightly smaller than last frame animation paint out empty area black leaving animation in middle clean edged.
 

Tom Mann

Guru
Messages
7,223
Likes
4,343
Sam accurately identified the two factors that let to your problem:
This is fairly simple, it's a result of how you duplicated the frames, it's also rotating off center.
a) Were you duplicating the original layer every time and then applying the rotation?
b) Or were you duplicating the previously duplicated and rotated image and then rotating it again?

What most people don't realize is that in a pixel based program such as PS (ie, in contrast to a vector based program such as Illustrator), every time you rotate, or even scale an image by some arbitrary amount, you lose some detail. This is most obvious at sharp edges, but it occurs throughout an image. If your next rotation step is based on the results of the previous rotation, the loss of detail adds up almost perfectly linearly (ie, not exponentially) with the number of steps.

For example, here is a starting image that consists of a 700px wide red rectangle on a black background. It has pixel-sharp edges.

Untitled-1-ps02_cropped-just_1st_and_last-01_orig.jpg

Next, here is the result Sam's method (b) applied in a series of 5 degree steps, rotating the rectangle 360 degrees around its center:

Untitled-1-ps02_cropped-just_1st_and_last-02_1_complete_circle.jpg

As you can see, the edge became wavy and soft. If I had done two complete rotations instead of one, the waviness and softness would each have been twice as much.

I used the plain "bicubic" interpolation method option for rotations. If I had used "bicubic softer", there would have been less waviness but more softness. If I had used the nearest neighbor (NN) interpolation method, the edge would have remained pixel sharp, but there would have been little triangle-like serrations along the edges.

Also, the larger the pixel dimensions of the objects being rotated, the waviness / softness becomes smaller as a fraction of the total size of the object. Since you were working on an object with very small pixel dimensions, these effects were fractionally much larger in your case and caused the "ripples" in your spinner.

The reason that Sam asked about method (a) is that this is the preferable method. This way, each new layer would be only one rotation away from the original, and the errors would not be cumulative like they are in method (b).

Another method that would greatly reduce this problem (and still be very easy from the POV of convenient repetitive keystrokes) is to start with a much larger image, say photographic sized, ie, several thousand pixels on a side, do your rotations and any other transformations you need at that scale, and then, as the next to the last step before you make an animated GIF out of the layers, down-rez it to the final size you need for your spinner.

HTH,

Tom M


PS - BTW, I changed the title of this thread to reflect the fact that these types of errors are simply cumulative, not geometrically increasing, and certainly not exponentially increasing with the total number of steps.

PPS - If you are familiar with PS's vector tools, you can successively rotate shapes / paths without running into this problem because they are not based on the discrete nature of individual pixels.
 
Last edited:

SCTRWD

Power User
Messages
457
Likes
239
Just my two cents

You can make this animation by applying Angle Gradient Overlay style and animating angle values:
 

Attachments

  • Spinner.gif
    Spinner.gif
    135.3 KB · Views: 14

Tr1plex

Member
Messages
5
Likes
2
Tom Mann (and others)...
Amazing. Thank you!
Naturally, I expect some 'minor blurring of the edges' and such. Just never seen it to this extent.
Thank you, not for your answers, but solutions.
The reason for the question is, I could see the potential in future projects using this same procedure, such as pattern making...
pattern.jpg
Of course, it wouldn't be useful if it distorted each step. :)
High praise, guys!
 

Top