Skip to content

Instantly share code, notes, and snippets.

View dacap's full-sized avatar

David Capello dacap

View GitHub Profile
dacap / Convert to Tilemap Quickly.lua
Created April 18, 2024 12:31
Convert current layer to a tilemap on Aseprite without showing the dialog
app.command.ConvertLayer{ ui=false, to="tilemap" }
dacap / Open as RGB.lua
Created December 12, 2023 00:57
Open as RGB
local oldSprite = app.sprite
if oldSprite ~= app.sprite then
app.command.ChangePixelFormat{ format="rgb" }
dacap / Open with Snap to Grid.lua
Created November 21, 2023 20:24
Open with Snap to Grid
local oldSprite = app.sprite
if oldSprite ~= app.sprite then
app.preferences.document(app.sprite).grid.snap = true
dacap / gui.xml.diff
Created August 30, 2023 14:58
Select as the pencil
diff --git a/data/gui.xml b/data/gui.xml
index ac89a3685..2af1545bf 100644
--- a/data/gui.xml
+++ b/data/gui.xml
@@ -1315,6 +1315,13 @@
tracepolicy="accumulate" />
+ <tool id="pencil_selection"
+ text="@.pencil"
Layer Head
Default Category:
* categories table: 0x55c3cbcda3e0
* folders table: 0x55c3cbcda4f0
* id 2
Layer Tilemap 1
Default Category:
dacap / show-category-names.lua
Created July 3, 2023 23:50
Usage: aseprite -b file.aseprite -script show-category-names.lua
local PK = "aseprite/Attachment-System"
local sprite = app.activeSprite
function find_tileset_by_catID(catID)
for _,ts in ipairs(sprite.tilesets) do
if and == catID then
return ts
dacap / Switch Non-Active Layer Opacity.lua
Created July 3, 2023 22:50
Switch Non-Active Layer Opacity
if app.preferences.experimental.nonactive_layers_opacity == 255 then
app.preferences.experimental.nonactive_layers_opacity = 128
app.preferences.experimental.nonactive_layers_opacity = 255
dacap / cleanEdge-shadertoy.glsl
Created December 22, 2022 18:03 — forked from torcado194/cleanEdge-shadertoy.glsl
cleanEdge, a pixel art upscaling algorithm for clean rotations
Copyright (c) 2022 torcado
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
dacap / New Frame Alternative.lua
Created November 28, 2022 19:07
New Frame without moving one frame tags
local s = app.activeSprite
if not s then return end
local f = app.activeFrame
local readjustTags = {}
for _,t in ipairs(s.tags) do
if t.fromFrame.frameNumber == f.frameNumber and
t.toFrame.frameNumber == f.frameNumber then
table.insert(readjustTags, t)
dacap / New Tilemap.lua
Created June 13, 2022 14:00
Creates a new tilemap layer with one tile per grid cell
local spr = app.activeSprite
if not spr then
return app.alert "You need to create a sprite first"
app.command.NewLayer{ name="Tilemap", tilemap=true }
local grid = spr.gridBounds
for y=grid.y,spr.height,grid.width do
for x=grid.x,spr.width,grid.width do