Having a weird ‘artifacting’ issue with sprites

Hi all, I’ve been having this ongoing issue, I think you could call it artifacting. Basically, some of my sprites are showing little slivers from the cells around them on the sprite sheet.

You’d think it might come from sloppy spritesheets. I’ve zoomed way in on them with aseprite and gimp, and they look perfect to me. But it’s clear that they are borrowing slivers of black from the sprites directly around them.

So far, I only see it in 2 instances: battle characters and balloon icons. I’m running in 1280x720, using lots of visustella plugins, including their map zoom.

Battle example:
IMG_2486.jpeg

That enemy was doing the idle animation, which looks like this in the spritesheet
IMG_2485.png


Balloon icon:
IMG_2484.jpeg

IMG_2483.png


I’ve tried searching about it, but couldn’t come up with any answers. The closest I found was this thread (https://forums.rpgmakerweb.com/index.php?threads/battle-actor-sprite-weird-artifacting.160179/) but the pictures are deleted.

Any ideas on what to do?
Maybe the problem is the resolution? I mean, 1280 isn't divisible by 48 and sometimes that can cause problems. Just for testing purposes, use 1248 and see if the artifacts are still there.
Maybe the problem is the resolution? I mean, 1280 isn't divisible by 48 and sometimes that can cause problems. Just for testing purposes, use 1248 and see if the artifacts are still there.

Hmm, now I’m getting some strange answers. I reduced it to 816/624, and when I soak to the npc from the side, the balloon comes up with no artifacts. But when I speak to him from the top looking down, it has the same artifacting…

I’ll keep experimenting. Thanks for the help!!
What map zoom plugin are you using? Perhaps it has something to do with it?

Also it is safe to leave 1 pixel margin space in your sprite sheet.
What map zoom plugin are you using? Perhaps it has something to do with it?

Also it is safe to leave 1 pixel margin space in your sprite sheet.

I’m using the visustella map zoom at 1.32 zoom. Just tried disabling it, but no change.

And yeah, at least with this problem, there’s a backup solution- redo the spritesheets, and shave a little off the balloons.
That would be difficult to use a plugin level fix because your zoom is not a whole number.
You'll need the smooth effect otherwise your pixels will deform.
So yeah you need to edit the sprite sheets to have the magin.
Are each cell, in pixels, in your sprite sheet an even or an odd number wide?
Are each cell, in pixels, in your sprite sheet an even or an odd number wide?
even, all multiples of 8. (16x16 or 24x24, then blown up larger.)
what are the total numbers for your spritesheet?
The pixel numbers actually there after resizing? not per cell but for the sheet

EDIT: and what is the percentage of the zoom of the plugin?
That is probably because MZ's sprite (or bitmap as its texture) is smooth by default.
You can turn it off using a plugin like pixel perfect, but that is not a real solution.
Yea, margins are probably the simplest solution here. 😴

Are you playing in windowed mode? If you maximise or full-screen the game window then that'll scale its contents, so it's worth checking to see whether it occurs in windowed mode first.

Like utunnels says, it looks like the engine is scaling the spritesheet with the default linear interpolation (creating the blurry edge), then applying the frame. "Pixel perfect" plugins generally use nearest-neighbour interpolation to eliminate this blurring, e.g.
The problem with doing so is that you may see occasional extra rows/columns of pixels in your sprites: sharp artefacts instead of blurry ones. As others have already said, you basically need to accept one or the other if you're going to use/permit fractional scales.
I would go from the above, add + 2 pixels and your problem is mainly fixed
the easy way 🙂

but 1 pixel margin like utunnels said is also the safest way to avoid issues
like those.
what are the total numbers for your spritesheet?
The pixel numbers actually there after resizing? not per cell but for the sheet

EDIT: and what is the percentage of the zoom of the plugin?

I make them 16x16 (spritesheet 144x96), and blow it up 5x, to 720x480. (This is for svactors - haven’t noticed clipping for regular character animations on maps)

I wondered if it might be because the cells weren’t clean multiples of 48, but I tried it at 6x as well (96x96) and the problem was the same. It also wouldn’t explain why I have this same issue with icon balloons, where everything is standard and normally sized.

Map plugging is at 1.32 zoom, so 32% increase, but it doesn’t effect battle.

That is probably because MZ's sprite (or bitmap as its texture) is smooth by default.
You can turn it off using a plugin like pixel perfect, but that is not a real solution.

Yeah, it seems like just reworking the spritesheets might be better

Yea, margins are probably the simplest solution here. 😴

Are you playing in windowed mode? If you maximise or full-screen the game window then that'll scale its contents, so it's worth checking to see whether it occurs in windowed mode first.

Like utunnels says, it looks like the engine is scaling the spritesheet with the default linear interpolation (creating the blurry edge), then applying the frame. "Pixel perfect" plugins generally use nearest-neighbour interpolation to eliminate this blurring, e.g.
The problem with doing so is that you may see occasional extra rows/columns of pixels in your sprites: sharp artefacts instead of blurry ones. As others have already said, you basically need to accept one or the other if you're going to use/permit fractional scales.

Ah, thank you for the explanation! It does occur in full screen and windowed. Yeah, I think some combo of game resolution/spritesheet dimensions/visustella plugins is setting this off.

The pixel perfect plugin is interesting, I’ll keep it in mind. But yeah, of the 2 solutions, redoing the spritesheets might be a little nicer looking. I feel like ‘sharp’ artifacting has the chance to stick out worse than blurry ones.

I would go from the above, add + 2 pixels and your problem is mainly fixed
the easy way 🙂

but 1 pixel margin like utunnels said is also the safest way to avoid issues
like those.

Yeah, I’ve started doing this and I think it’s the way forward. Thank you!
to 720x480.
but have you checked in the picture attributes of the picture size if it is really that size?
Your sentence structure sounds to me as if you just multiplied up without ever checking if there is a rounding error in the final result...

the artefacts you see are obviously the pixel lines from the next cell - otherwise they would go for the entire cell height. which means that the used selector has moved from its intended place (as a simplyfied description).

that can only happen with a rounding error on the sprite - and there are only two ways to introduce such a rounding error:
either the spritesheet is not exactly the required size, or there are calculations with the sprite before the final placement.
and those calculations are either by zoom or part of the mirroring of the sprite.

And I'm rather methodic in my bughuntings - due to some rather weird experiences where I searched for a bug in the wrong direction I never assume something is correct until it is specifically checked.
While it does look that the mirroring calculation is the most likely culprit and you'll have to add a frame around the sprites, I still prefer to have the other options checked as well.
but have you checked in the picture attributes of the picture size if it is really that size?

I did check the actual file info, and it’s the same. Also inspected the sprites very closely in gimp.

Thank you for explaining everything succinctly. I do think the sprite sheets are fine, and that the issue comes from how they’re being used in the engine. I also find it interesting that it’s happening with balloon icons as well, as they haven’t been blown up in size, and it occurred with them even with the zoom plugin disabled.

I’ll redo all the sprite sheets, but I agree, it would be nice to know what’s really going on. I’ll keep searching.
In that case, there is a rounding error somewhere in a mathematical calculation about the sprites.
unfortunately there are several places both in the engine and in plugins where that could have happened, and some of the plugins (especially Visustella's) have been obfuscated, preventing everyne from checking the formulae used.

one last try:
where or how did you mirror the sprite?
because in the battlescene it looks to the right, and in the image program screenshot it looks to the left.
If you have done this by plugin, that plugin could also be the cause.
In that case, there is a rounding error somewhere in a mathematical calculation about the sprites.
unfortunately there are several places both in the engine and in plugins where that could have happened, and some of the plugins (especially Visustella's) have been obfuscated, preventing everyne from checking the formulae used.

one last try:
where or how did you mirror the sprite?
because in the battlescene it looks to the right, and in the image program screenshot it looks to the left.
If you have done this by plugin, that plugin could also be the cause.

I do use mostly VS plugins, and I suspect the culprit is somewhere within there. (The mirroring comes from their battle core.) Also had another strange quirk, the ‘message glitch’ associated with their plugins, which people fixed by updating the nwjs. (Updating the nwjs fixed that glitch for me, but not this artifacting).

Thanks for the help!!

Original thread: https://forums.rpgmakerweb.com/threads/having-a-weird-artifacting-issue-with-sprites.175560/