GitHunt
IN

increpare/colourpalettizer3dtexture

A postprocessing effect for godot 4.4 that clamps the colours to a particular palette (generated by an image)

COLOUR PALETTIZER for GODOT

spingifsm

A small godot posteffect that fixes the colour palette. Other approaches I've seen do pretty heavy-duty shaders iterating over palettes, but this one generates a 3d texture in advance and just uses that as a lookup.

How to use

image

Look at the demo scene - the core is just the CanvasLayer and the Color Rect. Load an image int 'pattern source', and the script will generate the texture 3D and apply it to the postprocessmaterial on the colorrect (only at runtime right now - this can be a bit slow so ideally it would be nice to be able to save it...it shouldn't be hard to do).

You can supply anything as a palette - I use screenshots of palletes from aseprite:

image

You can also use screenshots of anything - my suggestion though is to downscale/blur the image in your favourite image editor, and then to reduce the colour palette of the image down to 64/128 colors - otherwise the search process can be very slow.

image

To tweak the noise, just look at the material attached to ColorRect and play around:

image

Languages

GDScript100.0%

Contributors

Created March 14, 2025
Updated March 24, 2025
increpare/colourpalettizer3dtexture | GitHunt