friction2d / friction

Friction Graphics
https://friction.graphics
GNU General Public License v3.0
277 stars 14 forks source link

Blurry images when sprite (image) is not in a pixel perfect position #222

Open mokalux opened 2 months ago

mokalux commented 2 months ago

Hello there, thank you for working on friction!

I have an issue when animating a sprite (animated sprite). When I set an animation to go from point A to point B, the animated sprite is not always on pixel perfect position (it can be positioned in a sub pixel position) then the image is blurry.

This happens only on non pixel perfect position. The exported animation is blurry on non pixel perfect position ( image2 sequence, QuickTime, mp4, metroska, ...).

When the animated sprite is on a pixel perfect position the image is clear as should be.

Possible fix would be to position the sprite (animated sprite) in the animation on pixel perfect only positions?

Hope you can reproduce the issue, else I can post some images.

Thank you ;-)

rodlie commented 2 months ago

Thanks for the report, I will look into this when I get the time.

A super simple example project file would be great if possible, no rush.

mokalux commented 2 months ago

Here is a sample project.

You can see the tent in two positions, one in a pixel perfect position (clear), the other one not (blurry).

If you move the second tent to be in a pixel perfect position then it becomes clear (please use 100% quality).

The same goes for the animation position.

Thank you for looking into this for v1.0, much appreciated! scene01.zip

PS: assets are cc0

rodlie commented 1 week ago

Sorry for the late reply. I'm able to replicate, but the export (PNG) is pixel perfect here.

in GIMP i have the original on first layer, second is a render with only the tent, the third is a render of everything. They are all identical.

https://github.com/user-attachments/assets/78f9c43e-d854-4760-bb76-5450191f6195

This is on Linux, I have not tested on Windows.

But regardless of the export this is a bug, but it seems to be in a third-party library (skia), or our usage of it. Will try to figure out where the problem is.