# \[Script\] Delete Transparent Frames

**URL:** https://community.aseprite.org/t/script-delete-transparent-frames/28137
**Category:** Scripts & Extensions
**Created:** [March 1, 2026, 2:21am UTC](https://community.aseprite.org/t/script-delete-transparent-frames/28137 "2026-03-01T02:21:29Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![manoairon](https://community.aseprite.org/user_avatar/community.aseprite.org/manoairon/32/25218_2.png) [@manoairon](https://community.aseprite.org/u/manoairon)
#### Post date: [March 1, 2026, 2:21am UTC](https://community.aseprite.org/t/script-delete-transparent-frames/28137/1 "2026-03-01T02:21:29Z")

</div>

Hi! I was trying to **reimport** a sprite sheet made in aseprite, which was exported with a .json for the animation tagging and easy game engine import.

My goal was learn how to make this export, so I was looking for how the file was in aseprite, to see the animation frames and its tags.

I found the [jest\_import\_existing\_tags.lua](https://community.aseprite.org/t/aseprite-scripts-collection/3599/27) script that works for import the animation tags by .json file.  
Install it and **don’t run it yet.**

1. First import the sprite sheet with “File - Import - Import Sprite Sheets”  
Then choose your image, slice (I used “by rows”, but it depends how all animations were rendered in one sprite sheet - and try divide the image width by the number of columns to get the cell width; divide the image height by the number of rows to get the cell height).

2. Install and run this lua script: (don’t forget to reopen aseprite or rescan scripts folder after install it)

```lua
local sprite = app.activeSprite
if not sprite then
  app.alert("No active sprite")
  return
end

local function isFrameEmpty(frameNumber)
  for _, cel in ipairs(sprite.cels) do
    if cel.frameNumber == frameNumber then
      if not cel.image:isEmpty() then
        return false
      end
    end
  end
  return true
end

app.transaction(function()
  for i = #sprite.frames, 1, -1 do
    if isFrameEmpty(i) then
      sprite:deleteFrame(i)
    end
  end
end)

app.refresh()

```

1. The empty frames will be deleted.
2. Use the [jest\_import\_existing\_tags.lua](https://community.aseprite.org/t/aseprite-scripts-collection/3599/27) with all the frames successfully opened and choose the .json file from the sprite sheet export, and voila! Your animations will be tagged as before!

Script 100% made by ChatGPT. Not give me credits, just posted here bc if I got it, somebody may want this too.
