mapeditor/tiled

Do you want to work on this issue?

You can request for a bounty in order to promote it!

Export As Image crops large tiles #3477

eishiya posted onGitHub

When exporting a map as image, it looks like the image bounds are calculated based on the sum of all the layers' cell bounds, and disregard the additional space required for tiles that stick out of their cells. In some cases, it's desirable to include tiles, Objects, etc that stick out of the map bounds. Originally reported on the forum: https://discourse.mapeditor.org/t/exported-image-is-cropped/5792

For example, this simple 4x4 ortho map with no layer offsets has a large tree tile in the last column, which I would expect to be visible in its entirety in the export: image

However, when actually exported, only the part of the tree that overlaps the cells' bounding box is included: imageexporttest

Here's a less contrived scenario from the user who initially reported this. They have isometric tiles that stick up from their cells, in addition to being offset to produce elevation: image They want these tiles fully included in the export image, but they are cropped right where the map cells end: image

A workaround is to add some empty cells at the edges of the map to fit this extra data within the map bounds, but users shouldn't have to do this, and it's likely to add more space than they need. Another solution is to offset an empty layer to add the necessary space to the map bounds, but this is even hackier.

There are scenarios where the current behaviour is desirable, so it is not a bug. The Export As Image dialog should offer the option "Crop to Map Bounds" (current behaviour) as a checkbox, enabled by default. When disabled, it would produce the results desired in above, expanding the canvas to fit overflowing content.

A related issue reported by someone else on Discord recently is that offset layers expand the map bounds even when they're mostly empty. Perhaps an independent trim option would help with that - this would remove empty* pixels around the edges of the image. * "Empty" does not necessarily mean transparent - the map may have a background colour set and the user will want that trimmed, but probably won't want to crop those parts of tiles/Objects that happen to match the background colour.


Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests