Exporting a tilesheet as a PNG
Hello, I am a Mac user, and I am trying to make a map for my Java FXGL game. I can't export a TileSheet as a .png. I can only export as a .tsx, a .json, or a .lua. I also can't click export as Image. Here are some screenshots:

I have looked for over an hour but I cannot seem to find a fix for this issue. Please help!
You're looking for a feature that simply isn't there, but I agree it would certainly be interesting to implement.
I'd be happy to implement it.
@codecustard Please don't hesitate to start working on it! I'm available for questions if you have any.
I think, since some options are involved, that you could introduce another dialog similar to the one that pops up when saving a map as an image, but with options that apply when creating an image from a tileset.
How would the exported image be different from the tileset's source image?
a source image may have margin, spacing and have a transparent color. An exported image doesn't need to have these properties I guess? The whole tileset itself could also be a collection of images. In that case one exported image could be nice. But the largest usecase is that a tileset image could be embedded into the map, which means that if you give the map to someone else, he/she can still get the tileset by exporting it.
any news on it ? this feature is really missing in tiled :(
any news on it ? this feature is really missing in tiled :(
No updates, doesn't look like anyone's made a PR referencing this issue. It is, however, now possible to implement this as a Tiled script using the Image API, at least as long as the target image isn't too large - you can create an empty image, copy each tile's image to it in the desired locations, and then save this image to a file. This functionality did not exist when this issue was opened. Of course, this would still require you or someone to write such a script, which would not be trivial, and a native implementation could be more efficient.
Unfortunately I've no skills for this kind of scripting. My game engine require PNG spritesheet of my tileset to work. So the only one solution I see is to make robot job in photoshop to manualy make spritesheet images.
Have you looked into software like Atlased or TexturePacker?
I just tried twice. Atlased won't seem to be able to import separate files images. It just import spritesheet, so I don't understand really it purpose. For TexturePacker, I can import all my tiles, but the software don't let define the ordre of the tiles. So I'm still stuck.
Atlased can definitely put multiple images into a sheet: https://github.com/witnessmonolith/atlased_documentation#sprite-packing And I'm pretty sure you can edit the sheet afterwards to maintain order, if it places them out of order.
Is this issue about exporting a tileset as a PNG? Because I think there is a workaround for this, by simply pasting the tiles in a new map and then exporting the map : -Using the Stamp Brush, select all the tiles in your tileset (click the top left tile in the tile set, shift-click the bottom right tile in the tile set). You should now have a stamp brush that contains all the tiles in the tile set. -Create a new map with the same tile pixel size as the tile set (I mean, the pixel size of individual tiles must be the same in this new tile map and in the tileset you want to export). -Click the new tile map so you "stamp" your tileset exactly at the top left of the map. Right-click anywhere outside the map to reset the stamp brush. -Hover your mouse over the bottom right tile and note its X and Y coordinates (shown in the status bar). -Using Map/Resize the map... , set the map width and height to the coordinates you just have noted, plus 1. -You can now use the File/Export as Image... and export this map containing all of your tileset as a PNG.
That's an excellent idea! I've actually used this approach before to rearrange tilesets, but completely forgot about it! There are some ways to make this process simpler:
-Using the Stamp Brush, select all the tiles in your tileset (click the top left tile in the tile set, shift-click the bottom right tile in the tile set). You should now have a stamp brush that contains all the tiles in the tile set.
In newer versions of Tiled, you can right-click in the tileset and Select All Tiles. This makes it much easier to select all tiles in a large tileset.
-Create a new map with the same tile pixel size as the tile set (I mean, the pixel size of individual tiles must be the same in this new tile map and in the tileset you want to export).
It might be easier to just create an Infinite map, it'll automatically size itself to be as large as needed.
-Hover your mouse over the bottom right tile and note its X and Y coordinates (shown in the status bar). -Using Map/Resize the map... , set the map width and height to the coordinates you just have noted, plus 1.
With an infinite map, you'd instead just set it to finite to crop it to fit. If you use a finite map, you can also skip all this measuring by using Map > Autocrop.
So, put all together:
- Make a new map with infinite size, and your tileset's tile size.
- If your tileset is an Image Collection, you'll need to use the largest tile's size.
- If you want spacing between the tiles, set the tile size slightly larger than your tile size.
- Right-click in the tileset in the Tilesets panel and Select All Tiles.
- Stamp those tiles anywhere in the map. Right-click outside the map to reset your brush.
- Uncheck "infinite" in the map properties, and it will be cropped to fit your tiles exactly.
- File > Export as Image
I was just noodling around with the "Rearrange tiles" feature, and it looks like the above exporting as map as a png wouldn't work with it - at least if you are intending to use the png as your new tileset image - because the .tsx records the old index of the tile and just puts it into a new order. So you you'd need to put them back into numerical order again in the tsx.
It would be useful to be able to rearange the tiles, have their properties follow as it does now, but also allow have a button/menu to update the png with them in the new positions and fix up the IDs back into numerical order.