Skip to content

Add option to export selected area - #4603

Open
leenattress wants to merge 2 commits into
mapeditor:masterfrom
leenattress:feature/export-selected-area
Open

leenattress wants to merge 2 commits into
mapeditor:masterfrom
leenattress:feature/export-selected-area

Conversation

@leenattress

Copy link
Copy Markdown

Summary

Adds an Only export selected area option to the Export As Image dialog.

When enabled, Tiled exports only the currently selected map area instead of the full map. The crop calculation accounts for renderer scaling and centering so the saved image matches the visible selection.

How It Works

  • Use Rectangular Select (R) to select the tiles you want to export.
  • Open Export As Image.
  • Enable Only export selected area.
  • Tiled exports only the selected tiles.

When Nothing Is Selected

  • The option is disabled, so it cannot be turned on.
  • Tiled remembers your previous choice, so it may appear ticked but greyed out.
  • Tiled checks again before exporting and shows a message instead of creating an incorrect image.

Why This Is Needed

For projects targeting constrained platforms such as the Game Boy (my personal use case), exported maps often need to stay within strict size limits.

A useful workflow is to design a large world as one connected map in Tiled: individual levels, rooms, and areas can be laid out together so their connections are visible and easy to verify. This is particularly helpful for tools such as GB Studio and NES studio, where seeing the whole world at once makes it easier to manage transitions and keep areas wired together correctly.

However, the game still needs each area exported separately. The new option allows selecting one area of the larger map and exporting only that selection as a PNG, without splitting the source world into many disconnected map files. This keeps the overview and editing workflow in Tiled while producing smaller images suitable for the target platform.

Testing

  • Added regression tests for selected-area image crop geometry.
  • Built and ran test_export successfully.

@leenattress leenattress changed the title Feature/export selected area Add option to export selected area Sep 1, 2026
@leenattress

Copy link
Copy Markdown
Author

Manually tested the Linux AppImage (I'm on arch today) built by CI. Selected-area export works as expectedfrom your build

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant