# Spritesheet bug

**URL:** <https://forums.solar2d.com/t/spritesheet-bug/357185>\
**Category:** Other\
**Created:** [February 14, 2025, 12:59pm UTC](https://forums.solar2d.com/t/spritesheet-bug/357185 "2025-02-14T12:59:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LowWah](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/l/3e96dc/32.png) [@LowWah](https://forums.solar2d.com/u/LowWah)\
**Post date:** [February 14, 2025, 12:59pm UTC](https://forums.solar2d.com/t/spritesheet-bug/357185/1 "2025-02-14T12:59:32Z")

</div>

I mentioned before that there was an issue with images in spritesheets showing a border, presumably the surrounding images. As there may be a chance i use Solar2D, i was looking into this a bit. I think it happens for images with transparent backgrounds.

First i generated a 432 x 432 image (144x144 3x3), filled it with white then removed the centre white square.

In a new Solar2D project (default settings) i loaded the image, e.g

```auto
local sheet = graphics.newImageSheet('sheet.png', { width=144, height=144, numFrames=9 })
local image = display.newImageRect(sheet, 5, 144, 144)

image.x = display.contentCenterX
image.y = display.contentCenterY

```

and i see this (notice a faint white border)

 ![image](https://forums.solar2d.com/uploads/default/original/2X/4/45dad754bcb36d818c576cece547fb60b3ae50a5.png)

Then i removed 1 px around the centre square, reloaded and the border disappeared, which is what i expected. Also when i filled the centre square with another colour, e.g red, i couldnt see any white border, my guess is that it gets overlayed above it, which is why its only noticeable on transparent backgrounds.

Another thing i noticed is that if i shift the coordinates 1 or 2 px, e.g

```auto
 image.x = display.contentCenterX + 1

```

the left/right or up/down border depending on x/y looks different (+ 3 makes it back the same), which make me think its some kind of render bug, cause if it was intentional changing coordinates wouldn’t make it different.

This probably isnt too big of an issue though, alll you need to do is make spritesheets have a transparent border per image, and since its mainly for animations, they’re probably setup like that anyways

---

<div class="post-metadata">

**Author:** ![system](https://forums.solar2d.com/uploads/default/original/1X/1bf6a947166df24e92aaa3358558f4b82d7f3d5a.png) [@system](https://forums.solar2d.com/u/system)\
**Post date:** [August 13, 2025, 12:59pm UTC](https://forums.solar2d.com/t/spritesheet-bug/357185/2 "2025-08-13T12:59:57Z")

</div>

Closed on August 13, 2025, 12:59pm UTC

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