# Tilesource cannot load a 6MB image？

**URL:** <https://forum.defold.com/t/tilesource-cannot-load-a-6mb-image/74215>\
**Category:** Questions\
**Created:** [September 24, 2023, 2:12pm UTC](https://forum.defold.com/t/tilesource-cannot-load-a-6mb-image/74215 "2023-09-24T14:12:53Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lipingyang](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/lipingyang/32/22354_2.png) [@Lipingyang](https://forum.defold.com/u/Lipingyang)\
**Post date:** [September 24, 2023, 2:12pm UTC](https://forum.defold.com/t/tilesource-cannot-load-a-6mb-image/74215/1 "2023-09-24T14:12:53Z")

</div>

![image](https://forum-defold-uploads.b-cdn.net/original/3X/3/9/39a3e5a4f863915b00b50995a861834852e6b2e3.png)

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [September 24, 2023, 2:26pm UTC](https://forum.defold.com/t/tilesource-cannot-load-a-6mb-image/74215/2 "2023-09-24T14:26:21Z")

</div>

It really should be possible, yes.  
You can check your editor logs to see if it output any hint as to why it failed.  
And/or you can perhaps share the image with us here so we can try it out.

---

<div class="post-metadata">

**Author:** ![Lipingyang](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/lipingyang/32/22354_2.png) [@Lipingyang](https://forum.defold.com/u/Lipingyang)\
**Post date:** [September 24, 2023, 2:29pm UTC](https://forum.defold.com/t/tilesource-cannot-load-a-6mb-image/74215/3 "2023-09-24T14:29:47Z")

</div>

![$00000 7 7 7 7](https://forum-defold-uploads.b-cdn.net/original/3X/3/4/34056567fe89585d54485a253d2b0b8cbf6092e2.png)

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [September 24, 2023, 4:03pm UTC](https://forum.defold.com/t/tilesource-cannot-load-a-6mb-image/74215/4 "2023-09-24T16:03:47Z")

</div>

Thanks!  
I don’t know why it takes so long, but we’ll take a look!

Note, when we read in the data, it’s in raw rgba format, so it becomes 16384_2048_4 = 128mb.  
It’s worth remembering when shipping as you’ll likely want to use texture profiles (compression) for the image.

---

<div class="post-metadata">

**Author:** ![Lipingyang](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/lipingyang/32/22354_2.png) [@Lipingyang](https://forum.defold.com/u/Lipingyang)\
**Post date:** [September 28, 2023, 2:50pm UTC](https://forum.defold.com/t/tilesource-cannot-load-a-6mb-image/74215/5 "2023-09-28T14:50:58Z")

</div>

will this problem be fixed? 😭 😭 😭

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [September 28, 2023, 4:12pm UTC](https://forum.defold.com/t/tilesource-cannot-load-a-6mb-image/74215/6 "2023-09-28T16:12:09Z")

</div>

> [@Lipingyang](#):
>
> ![$00000 7 7 7 7](https://forum-defold-uploads.b-cdn.net/original/3X/3/4/34056567fe89585d54485a253d2b0b8cbf6092e2.png)
> 
> $00000 7 7 7 715000×1500 6.91 MB

> [@Lipingyang](#):
>
> will this problem be fixed?

Well, the problem is that this image is 15000 pixels wide and 1500 pixels tall. When a texture is generated it will be updated to the nearest power of two in size. This means that the image will be 16384x2048 pixels. This is a large texture, or 16384_2048_4=134MB in size to be more precise, and to this mip maps should also be added, so we are looking at a texture close to 180MB.

I don’t think it is the size of the image itself that is a problem, rather the fact that it will be used as a tilesource with padding and margins and this seems to crash the editor. There are two solutions:

1. Cut up the image and use only a subset of the image
2. Trim away the excessive transparency between the images to reduce the size

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [September 28, 2023, 4:21pm UTC](https://forum.defold.com/t/tilesource-cannot-load-a-6mb-image/74215/7 "2023-09-28T16:21:05Z")

</div>

> [@britzl](#):
>
> There are two solutions

I take that back. There are three solutions:

1. Cut up the image and use only a subset of the image
2. Trim away the excessive transparency between the images to reduce the size
3. Set the width and height of the tiles in the tilesource to 160 x 160 and then set the image. This will not overload the editor and it will manage to create the tiles with the padding etc.

 ![Screenshot 2023-09-28 at 18.17.25](https://forum-defold-uploads.b-cdn.net/original/3X/0/9/0991e343a01065fc43ec2cc8b10bdccc2220250c.jpeg)

---

<div class="post-metadata">

**Author:** ![Lipingyang](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/lipingyang/32/22354_2.png) [@Lipingyang](https://forum.defold.com/u/Lipingyang)\
**Post date:** [October 1, 2023, 2:26pm UTC](https://forum.defold.com/t/tilesource-cannot-load-a-6mb-image/74215/8 "2023-10-01T14:26:54Z")

</div>

I chose the third option, although it’s a bit slow. thanks

---

<div class="post-metadata">

**Author:** ![Lipingyang](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/lipingyang/32/22354_2.png) [@Lipingyang](https://forum.defold.com/u/Lipingyang)\
**Post date:** [October 7, 2023, 11:46am UTC](https://forum.defold.com/t/tilesource-cannot-load-a-6mb-image/74215/9 "2023-10-07T11:46:13Z")

</div>

The latest version loads much faster!! I didn’t expect it to be resolved so quickly. This is a great community!! 😀 😀
