Tyrbo Asset generator Affiliates Make your game

Color Palette From Image

Give the extractor a screenshot, a concept painting, a photo or a finished sprite, choose how many colours you want, and it hands back the colours that best describe the picture. They come sorted by how much of the picture each one covers, so the first swatch is the dominant tone and the last is an accent.

It is built for game art: see-through pixels are left out of the count, and the result saves straight into the formats pixel editors read. Everything runs in your browser, nothing leaves your device, and it costs nothing.

Runs in your browser: nothing is uploaded.

How to use it

  1. Choose a picture. Pick or drop a PNG, WebP, JPEG or GIF. Large images are sampled evenly so the page stays fast on a phone.
  2. Set the colour count. Ask for anywhere from 2 to 64 colours. Start low, around 8, and raise it until the swatches cover what you see.
  3. Read the swatches. Colours appear most used first, each with its hex code, so you can see at a glance which tones carry the picture.
  4. Export it. Save a swatch PNG to share, a .hex list, a GIMP .gpl palette, or JSON for code and level tools.

How the colours are picked

The tool uses median cut. It gathers every opaque pixel, finds the colour channel with the widest spread, and splits the pile at its middle. It keeps splitting the biggest spread until it has as many groups as you asked for, then takes the average of each group as one colour.

Two things follow from that. First, clear pixels never count, so a sprite on a transparent background does not get a wasted slot for the empty space around it. Second, the colours are averages, not exact pixels lifted from the picture. On flat pixel art with fewer colours than you asked for, the result matches the art. On a painting, it is a summary of its mood.

Why limited palettes help a game

A small, fixed palette does a lot of quiet work in a game:

  • Everything belongs together. Characters, tiles and interface drawn from one set of colours look like one world, even when different people made them.
  • Things read at a glance. With fewer colours you can save the brightest, most saturated ones for what the player must notice: pickups, enemies, the thing that hurts. A busy background in muted tones keeps them visible on a small phone screen.
  • Changes stay cheap. Swapping one palette entry recolours a night level or a poison variant without redrawing.

Classic pixel art often sits between 8 and 32 colours. Pulling one from a mood picture is a fast starting point; you will usually nudge a few entries by hand afterwards.

Which file to save

The .gpl file is GIMP's palette format, and several pixel editors import it too. The .hex file is one hex code a line, the simplest list there is and easy to paste anywhere. JSON suits a script, a shader or a level editor. The swatch PNG is for people: drop it in a style guide or send it to whoever draws your game icons so the store art matches the game.

Questions people ask

Why does the palette not include an exact colour from my picture?

Each swatch is the average of a group of similar pixels. A colour used on only a few pixels can merge into a neighbour. Raise the count to give it its own slot.

Does a transparent background affect the result?

No. Pixels that are half clear or more are skipped, so only the visible art decides the palette.

Is there a limit on picture size?

There is no fixed cap. Very large images are read at an even sample of their pixels, which keeps the result close while the page stays quick.

Is the picture sent to a server?

No. The colours are worked out by code in your browser, with no upload and no model call. You do not need an account.

Have the game too? Describe it.

Make your game