# Tilemap layer selecting tiles is to difficult

**URL:** <https://community.aseprite.org/t/tilemap-layer-selecting-tiles-is-to-difficult/25179>\
**Category:** Help\
**Created:** [April 10, 2025, 9:43am UTC](https://community.aseprite.org/t/tilemap-layer-selecting-tiles-is-to-difficult/25179 "2025-04-10T09:43:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonSilva](https://community.aseprite.org/letter_avatar/jonsilva/32/6_449c533f586939b6e5f246632a46421f.png) [@jonSilva](https://community.aseprite.org/u/jonSilva)\
**Post date:** [April 10, 2025, 9:43am UTC](https://community.aseprite.org/t/tilemap-layer-selecting-tiles-is-to-difficult/25179/1 "2025-04-10T09:43:44Z")

</div>

hello,  
when i make a tileSet layer is there a way to select the tiles on the sheet ?  
instead of that tiny box on the left below the color pallete

if i hold CRTL i can see all the tiles nums but there is no way to select them ?

 ![tl](https://community.aseprite.org/uploads/default/original/3X/8/a/8ac1c91768fff8b7c20a4c7e718296d1210fc507.png)

---

<div class="post-metadata">

**Author:** ![behreandtjeremy](https://community.aseprite.org/user_avatar/community.aseprite.org/behreandtjeremy/32/6606_2.png) [@behreandtjeremy](https://community.aseprite.org/u/behreandtjeremy)\
**Post date:** [April 11, 2025, 2:45am UTC](https://community.aseprite.org/t/tilemap-layer-selecting-tiles-is-to-difficult/25179/2 "2025-04-11T02:45:28Z")

</div>

I agree that selecting tiles on the canvas is too difficult.

I’d expect that, when `TilemapMode.TILES` is active, the magic wand tool would have different behaviors and context bar options. I’d want the wand to create a tile-sized selection on the canvas under the cursor on click.

A workaround is to turn on the grid under `View > Show > Grid`, choose the magic wand tool, then go to the context bar and enable `Stop at Grid` in the options menu. (Unlike regular layers, when a tile map layer is active, the grid aligns with the tile map’s top left corner, and moves when the cel is moved.)

 ![stopAtGrid](https://community.aseprite.org/uploads/default/original/3X/1/9/191626e4ced66aaf23fb1bd38b8944b3a9f0b16b.png)

However, it’s easy to forget this setting is enabled and it’s not one that I want enabled in other contexts.

[Edit: Another workaround would be to go to `Edit > Preferences`, click on `Selection` in the lefthand column, then enable `Select a grid tile with double-click`. Then use the marquee tool instead of the magic wand. Again, not a feature I want enabled in other contexts.]

Another workaround is to use a [Lua script](https://aseprite.org/api). imo, this is only effective in a workflow where one hand is on the mouse and another is on the keyboard (to press a shortcut assigned to the script).

> **Click on the arrow to the left to see script**
>
> ```lua
> local activeSprite = app.sprite
> if not activeSprite then return end
> 
> local activeFrame = app.frame
> if not activeFrame then return end
> 
> local activeLayer = app.layer
> if not activeLayer then return end
> if not activeLayer.isTilemap then return end
> 
> local tileSet = activeLayer.tileset
> if not tileSet then return end
> 
> local activeCel = activeLayer:cel(activeFrame)
> if not activeCel then return end
> 
> local mouse = app.editor.spritePos
> local xMouse = mouse.x
> local yMouse = mouse.y
> 
> -- If you want to worry about tiled view mode:
> xMouse = xMouse % activeSprite.width
> yMouse = yMouse % activeSprite.height
> 
> local celPos = activeCel.position
> local xtlCel = celPos.x
> local ytlCel = celPos.y
> 
> if xMouse < xtlCel or yMouse < ytlCel then return end
> 
> local tileMap = activeCel.image
> local wSrcMap = tileMap.width
> local hSrcMap = tileMap.height
> 
> local tileSize = tileSet.grid.tileSize
> local wTile = math.max(1, math.abs(tileSize.width))
> local hTile = math.max(1, math.abs(tileSize.height))
> local xbrCel = xtlCel + wSrcMap * wTile - 1
> local ybrCel = ytlCel + hSrcMap * hTile - 1
> 
> if xMouse > xbrCel or yMouse > ybrCel then return end
> 
> local xGrid = (xMouse - xtlCel) // wTile
> local yGrid = (yMouse - ytlCel) // hTile
> local xTile = xtlCel + xGrid * wTile
> local yTile = ytlCel + yGrid * hTile
> local mapEntry = tileMap:getPixel(xGrid, yGrid)
> 
> local mapIndex = app.pixelColor.tileI(mapEntry)
> local lenTileSet = #tileSet
> if mapIndex >= 0 and mapIndex < lenTileSet then
> app.fgTile = mapEntry
> end
> 
> local _ = app.tool
> 
> -- To replace active selection:
> -- activeSprite.selection = Selection(
> -- Rectangle(xTile, yTile, wTile, hTile))
> 
> -- To add to current selection:
> activeSprite.selection:add(
> Rectangle(xTile, yTile, wTile, hTile))
> 
> app.refresh()
> 
> ```

Above is a simplification. More code would be required to, for example, cover all selection modes, contiguous vs. discontiguous selection, or sync the color bar range with the canvas selection.

---

<div class="post-metadata">

**Author:** ![Gasparoken](https://community.aseprite.org/user_avatar/community.aseprite.org/gasparoken/32/24720_2.png) [@Gasparoken](https://community.aseprite.org/u/Gasparoken)\
**Post date:** [April 11, 2025, 2:47pm UTC](https://community.aseprite.org/t/tilemap-layer-selecting-tiles-is-to-difficult/25179/3 "2025-04-11T14:47:08Z")

</div>

Just in case I’m sharing an extension which is a command to select all tiles placed on the tile map layer equal to the foreground color (primary tile).  
[SelectTiles.aseprite-extension](https://github.com/Gasparoken/asepriteScripts/tree/master/Extensions/SelectTiles)

Once the extension is installed, go to:  
_Select \> Fg Tiles on Tilemap_
