Pyxel Edit Forum Archive
ArchiveFeature requests

Power of two tileset export

E
empika
Sep 27, 2014 at 11:32 am
Hey there

Would it be possible to have the tileset export to a power of two size? This would be best for when importing to Unity etc as it helps improve performance and things.

At the moment my tiles are 32x32 and my tileset is 8 tiles wide and 10 tall. On export this results in an image that is 256x320, this is non power of two an so unoptimised. I'm currently editing the image to extend the canvas up to 512 tall so that it fits power of two. Could this be added as an option?

Thanks and keep up the great work!
Hamenopi
Sep 28, 2014 at 4:05 pm
You can change it to a ^2 value.
E
empika
Oct 2, 2014 at 7:28 pm
I can change what to a ^2 value? There is no way to change the output canvas size on the tileset export as far as I can see.
Hamenopi
Oct 3, 2014 at 4:34 pm
Oh! You mean like vertical padding on the bottom.

Resize Canvas to 512 x 512
Export Image
Job's Done

Danik
Oct 3, 2014 at 5:19 pm
Hi Empika,
As Hamenopi said, I think the best way is to simply make the canvas the size you need on export, unless I misunderstand the problem.
E
empika
Oct 5, 2014 at 4:19 pm
Yup, it's not quite as simple as resizing the canvas. I am exporting a tileset and a tilemap (json) to use with the tileset, so exporting a straight up image will actually just export a baked version of my tilemap.

Using tiles of 32x32 for example... I can control the width the tileset image is exported at by setting the tilset width to 8 (this will be power of 2), but the height of the tileset image is determined by how many rows of 8 tiles there are.
So if i only have 7 rows of tiles (56 tiles in total), the exported image height will be 224px high. It would be nice to be able to have the tileset exported as a power of two, so the image is actually 256x256, with a blank row at the bottom. Obviously it would be nice to the power of two to work horizontally and vertically.

Hope that makes a bit more sense. Maybe it's a bit more of a niche problem though.

P
phul
Oct 6, 2014 at 1:37 pm
Just say that you have 8 rows of tiles and export that. Gives me a x² image size.
E
empika
Oct 8, 2014 at 6:13 pm
Yeah, I guess I could just make a bunch of empty tiles
Danik
Oct 15, 2014 at 9:16 pm
Ah, I see what you mean. Yeah, that's a bit cumbersome. I don't know what the best solution would be though.