Palette Swaps and AI-sthetics

I’m working on a whole bunch of new systems now for a major extension to the platformer project that’s been in the press recently. My supervisor was keen to look at more creative angles on game design, and while initially somewhat skeptical about the idea I’ve really come around to it. I’ve been drawing up plans for a more artistically-minded ANGELINA (in all sense of the word) this week alongside similar work by other members of the group working in other areas of creativity.

I’ll be posting more about these elements as I’ve got concrete things to show, but one thing that’s quite fun to show off is some work I did on recolouring sprites based on a given colour palette. Little work exists on this problem that I could find (one paper looked at recolouring images based on the colourings of other images, but this is different as we only have a palette, rather than information about which colours should be dominant, etc.).

Being able to dynamically recolour sprites gives ANGELINA more flexibility in designing the visuals of the games it produces. It’ll also be a key step in adding flavour to a game design, by choosing appropriate palettes and automatically updating the sprites to reflect the new theme. With that in mind, below are a few different methods for recolouring the sprite from the New Scientist game. Let me know which method you think is best (obviously this is a very limited selection, but still worth considering). The two palettes used are Trick or Treat and An Enchanted Forest. Here’s the original sprite:

The first three methods I’m going to show take the original image and look at the relative distances between the colours in HSV space. They then attempt to find a mapping that minimises the change of these relative distances according to one of three metrics – Hue, Saturation or Variance.

Here’s ValuePriority-Hue


ValuePriority-Saturation


ValuePriority-Value (what a great naming scheme this was, eh?)

I also wrote some code that attempted to use simulated annealing, with the aim of producing a solution that minimised distance between colours in the Lab’76 space (it’s a more complex representation of colour, but one that apparently has a real basis in human perception). Here’s the results from that:

 Finally, my supervisor has done extensive work in art and visual tech himself, and he offered up another method. In this method, we map colours in the original image to whichever colour is closest in HSV space, and then set the Value component of the new pixel to its original setting. This changes the hue and saturation of the pixel but retains the relative visual detail. As you can see, it’s by far the most stable of the recolourings, but the loss of colour information detracts from the effect of the palette, and the effect isn’t as pronounced (this is partly because the method doesn’t guarantee use of all palette colours).

Let me know what you think of the various approaches! There are a few ways left to try (as you can see, some palettes might give us extra information, like the Enchanted Forest palette which attempts to ratio the palette colours). But we can’t always rely on such information being there.

6 thoughts on “Palette Swaps and AI-sthetics

  1. Prefferably I find the ValuePriority-Value is the better one to use. Seems like it has a bit of an evil tone to it.

  2. Personally I think that ValuePriority-Value is the best colour pallete (I assume that’s what I’m supposed to call it, I’m not sure) I think it shows the most detail in terms of what the graphic is meant to be (I also assume that these graphics are meant to be enemies or characters of some sort) with a sort of menacing look that the main character would be scared of and want to get rid of. In my opinion I think the other two palletes are slighlty bland in detail to the graphic itself.

  3. ValuePriority-Value all the way. I’d credit my liking of it to the contrasting of the black to orange, when they’re contrasted it creates a very fearsome and menacing appearance If you’re seeking for an enemy that appears powerful and difficult to fight, then this would be the best way to go.

  4. Thanks guys! What did you think of the last two options? Were they better or worse? They’re very different ways of colouring stuff. I think I prefer ValuePriority-Value, but I’m not sure.

  5. The last is certainly quite good (the silver and bronze ones) but It’s hard to view them as the foe. Perhaps if allies were incorporated that would be an excellent colour template. The one prior to last certainly has an excellent colour scheme and detail, and I’d consider it on par with the aforementioned template in my previous comment.

Leave a Reply to William Marshall Cancel reply

Your email address will not be published.