Texture Management in Defold

Common problems with textures

While we are on the topic of textures here are some common problems and how to fix them

Weird edge lines and texture seams

A common artifact is that your sprites can seem to have a weird edge (open image in new tab to see the problem)


This is easily resolved by increasing Margin or Extrude border on the atlas, you will get different result depending which you increase, generally I have found a better end result with Margin as extrude border tends to give a tiny edge artifact still. If you increase the any of the properties it is generally better to do it in even numbers because if you scale the size of the atlas down with the texture profile it could introduce some small errors.

Color noise and broken looking texture

This is less common but when I first saw it it took a while to track down what was the cause.


The cause is that you can’t have images that uses 16 Bits/Channel, so to fix it you have to convert the image. Either in your image editing software or with something like imagemagick.

Image get’s corrupted with black and white

I have gotten this after downloading and saving images with Python.


The cause is that you can’t have Indexed Color, so to fix it you have to convert the image. Either in your image editing software or with something like imagemagick.

Atlas is set as a texture

This one is easy to see and easy to track down, but worth mentioning anyway.


It looks like one texture have been replaced completely with an image of the atlas. I think this only happens on spine scenes and it gives no error at all. To fix it you only have to add the missing texture to the atlas.

20 Likes