Palette altered when loading/saving in .gif format

Hello,

When I’m working on my sprites I use Aseprite for making animations, and other software for some other tasks.

Recently I’ve been working in a project that requires palette swapping, so I am working with indexed colors and carefully organizing the palette in color groups for different parts of the sprite in Photoshop.

For convenience at work with my team I’m using gif files. The problem is that when I open with Aseprite a gif file created by Photoshop, Aseprite doesn’t detect its color mode as indexed by default (!)

imagen

And on top of that, when I save the file Aseprite alters its palette. I think it kind of shrinks the original palette, altering the index order of the colors, which is of vital importance to me :frowning:

After that, if I open the file in Photoshop I can confirm that the palette is broken :frowning:

imagen

You can find here the original file and the same file after being opened and saved again with Aseprite: https://drive.google.com/drive/u/0/folders/1Wt724TaIpRd-FyiM0meiqimeFXXv55Ez

I’m using Aseprite v1.2.16.3-x64 downloaded from Steam (and I’m on Windows 7 ultimate 64 bits).

Is there maybe a workaround for this? I’m kind of stuck I fear ^^U

P.S: I think this bug post also may be somewhat related to this feature request: Group Swatches Within Palette

1 Like

This is unrelated to the grouping feature request, which is purely cosmetic palette organization.

The “bug” here is that Aseprite optimizes the palette, removing redundant and unused colours. This is a useful feature in most cases, but it works against your workflow.
Unfortunately, palette organization is not standard, different programs save them differently, some with more or less optimization. Even Photoshop can eat up your palette if you’re not careful.

If your palette swapping code would allow it, I recommend including the palette as part of your spritesheet, and building the indexes for your palette swaps based on that rather than relying on a specific colour order in the files, since that’s unreliable. As a bonus, this should reduce your file sizes a little since you’d be dealing with fewer palette entries (the palette pixels would likely take up less space than the extra palette data).

1 Like

Hi, thanks for the answer! :slight_smile:

The palette swapping code that we use already uses sprites as palettes (each different palette is a sprite of 256x1 pixel size), but that’s not really the issue for me. The problem is that if Aseprite alters palettes, I cannot use it side by side with other programs such as Photoshop and Gimp, which I need to use for automating tasks (they save me lots of time).

Yes, I think that’s the problem. If one could choose between optimicing palette or not (checking a box for example), that would be great ^^

1 Like