2

I am jsut working on a new After Effects Project. I have a bunch of images I am working with and I just wondered, why the edges of images are so blurry.

First I thought it might have something to do with the fact that sometimes, images don't lay on whole pixel. So I used an expression to keep them on whole rounded pixels. BUT! even when they are laying on whole pixels, they have unsharp edges.

My Question is, is there any Opportunity to fix that and in case you know how, could you please tell me?

Thanks in advance!

  • Could you please add an image to your question? – p2or Apr 22 '15 at 14:29
  • @poor I think I found the reason. Position was on even pixels but anchorpoint wasn't. – Marten Zander Apr 22 '15 at 15:33
  • Ok, would be nice if you could write an answer. – p2or Apr 22 '15 at 15:34
3

So, I figured it out by myself. The problem was the anchorpoint. My images were on even pixels but the anchorpoint was odd.

So the solution is to use following expressions:

// Position
newX = Math.round(transform.position[0]);
newY = Math.round(transform.position[1]);
[newX, newY]

// Anchorpoint
newX = Math.round(transform.anchorpoint[0]);
newY = Math.round(transform.anchorpoint[1]);
[newX, newY]

UPDATE 2

Since I use this expression everytime now I am animating motion graphics, I thought it would be cool to make an actual after effects script of it. You can purchase it here: FIXL -Snap Layers to Pixel

UPDATE

When you try to animate layers with these expressions, it comes to rough animations. That's why I wrote a new expression that only applies if a keyframe is set. So its safe that whenever an image or layer is resting on the same position for a longer time, it will stay on even pixels.

Add this Expression to the position property of your layer:

n = transform.position.numKeys
t = time;
timeOfKeyframe = null;

for(i=1; i <= n; i++){
    if ( t == transform.position.key(i).time ){
        timeOfKeyframe = transform.position.key(i).time;
    }
    else{
        value;
    }
}

if (t == timeOfKeyframe) {
    keyValue = transform.position.valueAtTime(timeOfKeyframe);
    roundedValue = [Math.round(keyValue[0]),Math.round(keyValue[1])];
}
else{
    value;
}
  • +1 Thanks for sharing your experience! – p2or Apr 23 '15 at 7:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.