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.
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.