Unclaimed Package Is this your package? Claim it to unlock full analytics and manage your listing.
Claim This Package

Install via UPM

Add to Unity Package Manager using this URL

https://www.pkglnk.dev/max05643-aseprite.git

README Markdown

Copy this to your project's README.md

Style
Preview
pkglnk installs badge
## Installation

Add **Modified 2D Aseprite Importer** to your Unity project via Package Manager:

1. Open **Window > Package Manager**
2. Click **+** > **Add package from git URL**
3. Enter:
```
https://www.pkglnk.dev/max05643-aseprite.git
```

[![pkglnk](https://www.pkglnk.dev/badge/max05643-aseprite.svg?style=pkglnk)](https://www.pkglnk.dev/pkg/max05643-aseprite)

Dependencies (4)

README

A custom modification of com.unity.2d.aseprite that allows you to import palettes from Aseprite and swap them at runtime.

  • Saves video memory
  • Dynamically changes the appearance of sprites using different palettes without storing separate sprite variants

example

Motivation

Aseprite allows you to use Indexed Color mode and switch between different palettes without modifying the sprite itself. If a palette contains fewer than 256 colors, it is possible to recreate this technique in Unity.

In this approach, the imported sprite sheet becomes an R8 texture that encodes color indices, while a separate palette texture is used as a lookup table. If your sprite sheet is large enough, this can significantly reduce video memory usage. Multiple palettes can also be combined into a single lookup texture and switched at runtime by changing a shader property.

This plugin modifies com.unity.2d.aseprite to allow developers to take advantage of this technique.

Installation

Open Window → Package Manager. Click + → Install package from git URL. Enter https://github.com/Max05643/com.max05643.aseprite.git, then click Install.

Workflow

  1. Create an Aseprite file using Indexed Color mode. The palette must contain fewer than 256 colors.
  2. Create several palettes for the file and export them as .png files. Change their extensions to .palette.
  3. Import all palettes into Unity.
  4. In your project, create a palette collection: Create → Aseprite → Palette Collection.
  5. Assign the individual palettes to the palette collection.
  6. Import the .ase file into Unity. Set Palette Interaction Type to Use External. Assign your palette collection to Palette List. Assign one of the built-in palette shaders (URP or Built-in RP).
  7. Use the automatically generated prefab.
  8. In your scene, add the PaletteDynamicChanger script to the prefab instance.
  9. Assign your palette collection to PaletteDynamicChanger.
  10. Change currentPaletteIndex and enter Play Mode.
  11. Alternatively, use the public ChangePalette method in PaletteDynamicChanger to switch palettes at runtime.

You can also use multiple PaletteDynamicChanger components on a single prefab instance if you need to change palettes independently for each imported Aseprite layer. See the Samples for an example of the correct setup.

Import modes

This modification adds two new import modes to the .ase importer: Create From File and Use External.

Create From File Automatically creates a palette from the .ase file if fewer than 256 unique colors are used. This mode is useful for testing.

Use External The primary mode intended for production use. You must create a palette list asset and assign it in the importer settings. You can then use PaletteDynamicChanger with the generated prefab to dynamically switch between palettes from the assigned list.

Scriptable Pipelines Support

  • Universal Render Pipeline is supported. The shader supports the SRP Batcher. URP is strongly recommended.
  • Built-in Render Pipeline is supported, but GPU instancing does not work. You may use it as is or modify it further if needed.

Comments

No comments yet. Be the first!