# Exporting sections of a grid as a PNG \[RESOLVED\]

**URL:** <https://discourse.mapeditor.org/t/exporting-sections-of-a-grid-as-a-png-resolved/2043>\
**Category:** Questions\
**Created:** [February 14, 2017, 6:59am UTC](https://discourse.mapeditor.org/t/exporting-sections-of-a-grid-as-a-png-resolved/2043 "2017-02-14T06:59:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joel\_Conway](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/joel_conway/32/1036_2.png) [@Joel\_Conway](https://discourse.mapeditor.org/u/Joel_Conway)\
**Post date:** [February 14, 2017, 6:59am UTC](https://discourse.mapeditor.org/t/exporting-sections-of-a-grid-as-a-png-resolved/2043/1 "2017-02-14T06:59:54Z")

</div>

Hey there! Excellent tool! I love using this thing.

However I’ve come to a bit of a problem, I want to export my file as a PNG - I know how to export the entire thing, however I want to just export small sections of the grid Into separate png files (these sections are rooms similar to the overworld view in legend of Zelda style games)

Is there anyway I can do this other than exporting the entire thing, then cutting it up in photoshop? This is my go to approach but I’ve had to start changing areas and this has become a bit of a hassle to do.

Maybe some sort of command line I could try - has anyone had to do something like this before?

---

<div class="post-metadata">

**Author:** ![bjorn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/bjorn/32/1599_2.png) [@bjorn](https://discourse.mapeditor.org/u/bjorn)\
**Post date:** [February 14, 2017, 7:08am UTC](https://discourse.mapeditor.org/t/exporting-sections-of-a-grid-as-a-png-resolved/2043/2 "2017-02-14T07:08:33Z")

</div>

This is currently not possible. Though there of course ways to automate cutting up the image on the command-line, like using [ImageMagick](http://www.imagemagick.org/script/index.php), I imagine this could also be a feature of the `tmxrasterizer` tool shipped with Tiled.

Also, once there is support for [custom grids](https://github.com/bjorn/tiled/issues/368) in Tiled, these grids could be used for generation of multiple images.

---

<div class="post-metadata">

**Author:** ![Joel\_Conway](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/joel_conway/32/1036_2.png) [@Joel\_Conway](https://discourse.mapeditor.org/u/Joel_Conway)\
**Post date:** [February 14, 2017, 7:26am UTC](https://discourse.mapeditor.org/t/exporting-sections-of-a-grid-as-a-png-resolved/2043/3 "2017-02-14T07:26:31Z")

</div>

Ah! That’s a shame, but thank for the quick response. I’ll check out the other options you pointed out. Thanks for the help

---

<div class="post-metadata">

**Author:** ![Axolotl](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@Axolotl](https://discourse.mapeditor.org/u/Axolotl)\
**Post date:** [February 16, 2017, 10:49am UTC](https://discourse.mapeditor.org/t/exporting-sections-of-a-grid-as-a-png-resolved/2043/4 "2017-02-16T10:49:04Z")

</div>

If you will use imagemagick (which can be really-really timesaver in making tiles and other work with multiple sprites) the command line will be like this:

convert input\_file.png -crop 10x10@ +repage +adjoin output\_file.png

This will crop your big image into 100 pieces (10x10), of course you can change this number.

---

<div class="post-metadata">

**Author:** ![Joel\_Conway](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/joel_conway/32/1036_2.png) [@Joel\_Conway](https://discourse.mapeditor.org/u/Joel_Conway)\
**Post date:** [February 23, 2017, 12:19am UTC](https://discourse.mapeditor.org/t/exporting-sections-of-a-grid-as-a-png-resolved/2043/5 "2017-02-23T00:19:59Z")

</div>

Ah! Actually, I managed to get round this by quickly making a photoshop  
macro. I check for the overall size of the image, it then saves then crops  
the image down to the size of each screen and saves those images as PNG  
files into a folder. I’ll happily share the code if people are interested.
