Easily swap palletes, with intelligent color swap

Hello, I’ve been trying out different palletes on existing drawings (colors=indexed). For example, swapping between multiple existing 24color palletes to see what works best.

The problem is that when you swap the pallete, the new color which replaces each old color has no criteria, I assume (since it doesn’t look good after the swap - it seems random).

So I’d like a way to automatically find the “best” possible color swaps between two same-sized palletes, e.g., for each color on the new pallete it would find on the original pallete which color it would replace. I understand there are ways to compare colors (Color difference - Wikipedia) and that this could be solved try to find the best match.

I was wondering if aseprite already has this feature or if there is already a plugin ?

Thank you.

1 Like

It isn’t random, it goes by the order of the colours in the palettes.

You can swap palettes by going to RGB mode, changing the palette, and going to Indexed again. That will do the “smart” conversion you want.

In Indexed mode, the index-based behaviour is usually what is needed, so it wouldn’t make sense to change that IMO.

2 Likes

i was just writing same reply as eishiya did, so i’ll just add this: you can also use remap button.
however, you won’t get perfect results either way. here’s an example:
aseprite-palette-swap
change palette A to B: simple change, remap, convert and actual result you would want.

1 Like

Hello thank you for the answers so far. I’ve tried out a few examples. I still think the auto remap does not fulfill my needs. For example, I’d like that the “reds” from pallete 1 would match the “reds” from pallete 2 (as well as possible, as I understand that comparing colours is not trivial). That’s not what the “remap” button does, right ? It didn’t seem to look at color rgb/hsv, just pallete indexes.

1 Like

Not right. Just indexes work when you load different palette. Then ‘Remap’ button tries to remap old colors of your image to best new indexes in new palette. But this ‘best’ could be not quite what you want, because it considers hue & lightness, but you may need remap to brighter tone in new palette. So you’ll need to manually replace some colors before/after remapping.

1 Like

Do you want it to find colors with closest hue and ignore lightness/saturation differences, but no more than closest same hue colors lightness/saturation in original palette?

Maybe script to replace palette with hue/lightness/saturation weights and checkboxes to limit to closest by lightness/saturation/hue will work for you. When someone will code this script :slight_smile:

I’ve wondered, though never explored, if scaling the range of the source palette to fit the range of the destination palette (at the simplest an AABB mapping) before performing colour matching could produce better results without manual fiddling.

It works very well for monochrome destination palettes at least, I’ve used it when downsampling art to put on the Game Boy. I haven’t done much testing with broader palettes, mainly because there aren’t easy tools for it available to me.

1 Like

Hello everyone. Again thank you for the feedback and ideias. I decided to write this script.

It’s here A script to map two color palletes using delta_e_cie2000 · GitHub

It uses delta_e_cie2000 (see deltaE Color difference - Wikipedia) from the colormath python library. This is a standard criteria to compare colors, since only hue or only grayscale, or even rgb mean are not adequate according to several internet sources.

I’m very happy with the results. See below a mapping of fantasy24 into vinik24 (see lospec site)
image

Of course it’s not perfect since not all colors have equivalents on either side, but for me it seems great enough.

4 Likes