# Remove duplicate cel script?

**URL:** <https://community.aseprite.org/t/remove-duplicate-cel-script/7012>\
**Category:** Scripts & Extensions\
**Created:** [September 22, 2020, 4:18pm UTC](https://community.aseprite.org/t/remove-duplicate-cel-script/7012 "2020-09-22T16:18:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonny\_Hunter](https://community.aseprite.org/user_avatar/community.aseprite.org/jonny_hunter/32/5326_2.png) [@Jonny\_Hunter](https://community.aseprite.org/u/Jonny_Hunter)\
**Post date:** [September 22, 2020, 4:18pm UTC](https://community.aseprite.org/t/remove-duplicate-cel-script/7012/1 "2020-09-22T16:18:32Z")

</div>

Hello, I am looking for a script that would remove any duplicate cels. Anyone know if one exists?

---

<div class="post-metadata">

**Author:** ![eishiya](https://community.aseprite.org/user_avatar/community.aseprite.org/eishiya/32/902_2.png) [@eishiya](https://community.aseprite.org/u/eishiya)\
**Post date:** [September 22, 2020, 5:52pm UTC](https://community.aseprite.org/t/remove-duplicate-cel-script/7012/2 "2020-09-22T17:52:17Z")

</div>

What specifically do you mean by removing duplicate cels? Within a frame, where different layers contain duplicate data? In a layer, perhaps converting them to linked cells instead? All across the image, potentially messing up the appearance of some frames?

---

<div class="post-metadata">

**Author:** ![Jonny\_Hunter](https://community.aseprite.org/user_avatar/community.aseprite.org/jonny_hunter/32/5326_2.png) [@Jonny\_Hunter](https://community.aseprite.org/u/Jonny_Hunter)\
**Post date:** [September 22, 2020, 8:33pm UTC](https://community.aseprite.org/t/remove-duplicate-cel-script/7012/3 "2020-09-22T20:33:19Z")

</div>

I’m trying to import a sprite sheet then remove any frames that are identical. I would do it manually but I would be going through hundreds of frames for each sprite sheet that I want to process this way.

---

<div class="post-metadata">

**Author:** ![eishiya](https://community.aseprite.org/user_avatar/community.aseprite.org/eishiya/32/902_2.png) [@eishiya](https://community.aseprite.org/u/eishiya)\
**Post date:** [September 22, 2020, 8:56pm UTC](https://community.aseprite.org/t/remove-duplicate-cel-script/7012/4 "2020-09-22T20:56:15Z")

</div>

Ah, so you’re trying to remove duplicate _frames_, not _cels_. A cel is the intersection of a frame and a layer, a frame may be composed of multiple cels.

The next question is whether you want only consecutive duplicates removed (and have the durations for the remaining frames adjusted), or if you’re just looking to reduce your spritesheet to unique frames, with no consideration of how those frames are used in animation.

In the latter case, you could export your animation as a spritesheet with “Merge duplicates” checked. That’ll give you a spritesheet with only your unique frames. If you export the accompanying JSON as well, that will preserve your animations/tags (if any) and it will preserve the information about the different frames, except the frames will all point to the same spot in the spritesheet.

---

<div class="post-metadata">

**Author:** ![Jonny\_Hunter](https://community.aseprite.org/user_avatar/community.aseprite.org/jonny_hunter/32/5326_2.png) [@Jonny\_Hunter](https://community.aseprite.org/u/Jonny_Hunter)\
**Post date:** [September 22, 2020, 9:43pm UTC](https://community.aseprite.org/t/remove-duplicate-cel-script/7012/5 "2020-09-22T21:43:08Z")

</div>

Exporting using merge duplicates did exactly what I was looking for. Thanks for the help!
