Fuzziness/compression with pen trails/stamp?

Hey y'all, this is the time of year my students are finishing up their animation projects. Last year you helped me learn about the [pen trails]/[stamp] blocks:

This year a few of my students are trying out that strategy to speed up performance, and they noticed that the pen trails version is a little fuzzy compared to the directly-drawn version of their sprite.

Is pen trails creating a compressed image? If so, is there a way to control the compression level?

Also I see in the manual about the 'log pen vectors' option -- would that force the pen trails/costume to be an exact reproduction of the sprite?

That fuzziness is a result of the javascript canvas having anti-aliasing turned on both for drawing and stamping. There's not much you can do about it without modifying the snap source code.

That option just records the sprite's movements to then create an svg out of them. It doesn't include text or stamping.

ok interesting, thx.

So would the aliasing be affected by the size of the stage when pen trails is clicked? Like using the expando between the stage and scripting area; or by fullscreening the stage?

oh thats weird, why not?

No, it would not be affected by the size of the stage.

Because it's not coded in, I don't know why.

to be fair, that question wasnt really meant for you

I personally think the fuzziness is affected by the fact that the size of the pen trail image is odd, so you might need to offset the sprite paster by 0.5 on each axis until not blurry. :slight_smile:

I don't think that's it

the pen trails image isn't compressed, it's blurry because of the size of the stage and position of the sprite. unfortunately snap doesn't provide a way to fix this for all displays and view modes. you can still take a few steps to mitigate this issue:

  • set the stage size to 538x404 to match the project page player
  • don't view the project in full screen or on a high dpi monitor, these both rescale the stage
  • after getting pen trails, only move the sprite a whole number of pixels. this is much easier if you already have the sprite on an integer coordinate from the start (like 0,0).
  • make sure your sprite size and rotation aren't accidentally off. you can use both for various effects but they will add blur when stamping again.

90 degree rotations and whole multiple scaling (200%, 300%, etc) can be used without causing blur but you might need to offset the sprite position to compensate (usually half a pixel depending on if the costume has an odd or even width)

if you need to support high dpi displays i guess you could have the project ask the user what scaling they're using and round your coordinates based on that instead. i think the proper pixel coordinates to use would be multiples of the reciprocal of the scaling offset from the top left of the project? i haven't tested this.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.