• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Layers "shake / wiggle" when working on pixel art animation (small size composition)

New Here ,
Jul 19, 2023 Jul 19, 2023

Copy link to clipboard

Copied

Hi!

I'm working on a project in pixel art, drawing in Aseprite and animating in After Effects (2023).

 

The scene is 320x180, I scale the composition x6.0 and export to 1920x1080 and everything looks good as long as I keep layers on the proper mode (NO antialiasing) and the proper export settings.

The scene consists of a beach stroll, with a looped background. There is this one big parent layer, which is the sand/floor, and I just set the elements/layers on top to follow along that layer (with the spiral button thing), so they pass by at the same speed as they were laying on the sand.

The thing is... Some of the layer seem to be "attached" propperly to the sand, but some of them "wiggle" or "shake" a little as they pass by. I'm guessing this happens because the top layers are moving internallly in fractions of pixels, so sometimes when they render they appear to be a pixel ahead/behind and sometimes they are on "whole pixels" and they look ok. Is there some way to prevent this? This happens even in preview, before scaling the composition. I tried making sure the FIRST and LAST frame of each layer starts and ends in a whole pixel position but same result. If I manually tweak the position of a "shaky" element (a pixel to the left, or a pixel to the right), it sometimes "stabilizes", but I can't do that with each layer manually.

I hope I explained myself. You can clearly see what I'm talking about in the video attached (look at the guy inside the Beach Club, compared to other elements on the scene).


Thank you!

TOPICS
Error or problem , How to , Performance , Preview , User interface or workspaces

Views

155

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 19, 2023 Jul 19, 2023

I think you are experiencing a stroboscopic effect caused by the distance traveled per frame and the frame rate. If the layer does not move a whole number of pixels per frame, it will snap to the nearest pixel. If the layer is not perfectly aligned with the pixel grid it will snap to the nearest pixel. 

 

For example, if the movement is .8 pixels per frame, then the movement would look like this: .8, 1.6, 2.4, 2.8, 3.2, 3.6. You end up with position changes that look like this: 1, 2, 3, 3, 4. Yo

...

Votes

Translate

Translate
LEGEND ,
Jul 19, 2023 Jul 19, 2023

Copy link to clipboard

Copied

Apply some Math.floor() expressions to quantize all motion values to full pixel increments.

 

Mylenium

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 19, 2023 Jul 19, 2023

Copy link to clipboard

Copied

I think you are experiencing a stroboscopic effect caused by the distance traveled per frame and the frame rate. If the layer does not move a whole number of pixels per frame, it will snap to the nearest pixel. If the layer is not perfectly aligned with the pixel grid it will snap to the nearest pixel. 

 

For example, if the movement is .8 pixels per frame, then the movement would look like this: .8, 1.6, 2.4, 2.8, 3.2, 3.6. You end up with position changes that look like this: 1, 2, 3, 3, 4. You get double frames. When the video is playing at full speed, you also have to combine that with the average human retinal retention frame rate of about 20 frames per second and the frame rate of the composition, and you end up with a motion that not only Judeers but that duplicates position every few frames.

 

You can solve that by controlling movement with an expression. This will give you horizontal movement that moves exactly a whole number of pixels per frame:

t = time / thisComp.frameDuration;
f = 6; // pixels per frame
m = t * f;
[value[0] + m, value[1]]

You'll have to adjust the "f" value to match the frame rate to avoid a Stroboscopic Judder caused by the frame rate, but the expression will always move the layer a whole number of pixels per frame. You just have to make sure that your artwork is perfectly lined up with the pixel grid. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 22, 2023 Jul 22, 2023

Copy link to clipboard

Copied

LATEST


Thanks a lot to both of you.

Rick, thank you for your great explanation. Not only I can solve the issue but now I understand better the what caused the issue and how After Effects works. Thank you very much for your time.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines