Indexed Color / Colormapping support

Something my friend was disappointed to see missing from PixiEditor was support for using Indexed Colors, specifically being able to import and export png files using the indexed color format, but I believe that more general support for color mapping/Indexing would be practical.

To be clear, although PixiEditor dose have a Palette and Swatches feature, it appears these are mainly to serve as a convenient way to select a color from a list, not as a means to map specific colors to specific indexes, or a way to map specific pixels to specific color indexes.

This is a feature that my friend makes use of all the time in GIMP, it prevents you from adding too many colors to a sprite that is intended to fit a limited color pallet, can be used to easily swap between different color pallets on the fly, and by exporting as a Palette-based png, (ie 8bit / 4bit pixel depth instead of 24bit RGB pixel depth) allows for less memory usage in video-game development, and better compatibility with projects targeting retro platforms / art styles.

To help clarify, for example, using the current Palette tool, if you try to add two different indexes / palettes with the same color. PixiEditor treats both as if they had the same index.

This is in contrast to GIMP’s Colormap tool.

It’s possible there might be good reasons why this is not a feature of PixiEditor, I understand that the Graph / Node tools are built around treating colors as 3part vectors, so introducing indexed colors / Colormapping could cause some complications with that system, and may even require introducing new Nodes and or sockets to convert between the color modes. (Something similar to the UV Sample Image node)

Which brings me to my last point, I believe that adding support for Indexed Colors / Color Mapping would serve as a practical building block for more complex features to build off in the future. I have seen other feature Request that would appear to be easier to implement given the ability to map specific pixels of an image to specific color indexes, rather then a specific color.

Apologies for the wall of text, hopefully my explanation wasn’t too difficult to follow. TBH even just adding an option to export a PNG in a palette image format instead of in a RGB format would be very useful!
Regardless I really like the UX design of PixiEditor, and plan to use this as my main Image editing software from now on! :smiley:

1 Like

I like this feature. A game engine I am looking to use could make use of this, so yeah, :+1: for it

(If you’re curious, it’s Hatch Game Engine, though nCine has support for it too)

It’s a very well written request, moving it to the official proposals category. It will now be visible on pixieditor.net and users can vote on it. I’ll set a fresh 3 month discussion phase from today.

Proposal status: open-for-discussion
Discussion ends: 2026-05-06

Haven’t yet seen the proposal on the homepage so hoping that gets there at some point. Do likes on this issue ([FEATURE]: Indexed color palette support and dithering · Issue #1034 · PixiEditor/PixiEditor · GitHub) also count? Or they have to be registered members who vote for the feature?

As far as the feature goes, I do think it’s one of the most important, specially due to many older systems and consoles having to rely on this system to display colors, up there with custom aspect ratios and variable pixel sizes, so yeah, as I mentioned before, it’s nice :-)))

GitHub likes does not count towards proposal on the website, only votes on the forum do.

Although likes by itself doesn’t decide whether the feature will be implemented. Quality of the proposal and strong enough evidence will ultimately wage the decision.

My question is, how do you imagine this feature to be implemented in PixiEditor? You mentioned, that the tools should reference palette colors, does it mean that whenever the document is in the indexed mode, any color freedom is disabled and only palette colors can be used?

How is your proposal different to already implemented palette color replacer built inside palette tab in PixiEditor? You can drag your palette color and choose new color, this will replace all pixels on the canvas to use your new color.

Well, in indexed mode, each pixel is a reference to the palette. Isn’t the case that PixiEditor works using primarily the RGBA model (32bpp) and palettes are associated with that while in indexed-mode, you only work with 8bpp and LUT (Lookup Tables) to save on space and memory. What the OP was asking is support for PNGs with using indexed color format, is different from what you’re mentioning because the palette color replacer doesn’t necessarily align with that format. The thing is that in homebrew platforms, you simply cannot change freely or replace the colors as easily as one might think because the hardware restrictions surrounding that palette and the format associated requires that specific values be addressed to the hardware at hand. This is what indexed solves and so while PixiEditor does covers modern RGBA workflows, the indexed support is not there.

This is what I think they are asking for (more info could be found at Indexed color - Wikipedia and here Cheap pixel-art color swap based on LUTs: An article · GitHub ) the latter explains: “Pixel-art is a palette-limited image that uses strictly specific colors, and those colors can be easily swapped in the editor. But what about doing it at runtime without a need to re-edit them? For example on sprites to make them appear belonging to a specific team. That technology was used for a long time, but with modern pixel-art games using PNGs, it became harder to do so, since those are not indexed colors.”

I did mention on the issue though that my knowledge of that was based around the fact that I only discovered this due to a comment on HN suggesting that to be added, and others chiming in for the fact. I would like to know what you think since many artists swear by this feature.

(I also recommend 2dneverdie’s article on “So you want your sprites to be 16 colors” who walkthroughs how to conform to the limitations and create something that works at runtime for those platforms)

My question is, how do you imagine this feature to be implemented in PixiEditor? You mentioned, that the tools should reference palette colors, does it mean that whenever the document is in the indexed mode, any color freedom is disabled and only palette colors can be used?

That is kinda how gimp implements it, it seems gimp will just pick one of the indexed colors that is closest to the color you are trying to use, (which IMO it really should have some indication to the user that that is what’s happening instead of just doing it silently.)

Really though the most important thing would to be able to export PNG files to preserver the indexed pallet information. Specifically the PLTE data chunk specified here: PNG Specification: Chunk Specifications
(All PNG files contain multiple data chunks used to store formatting information, the PLTE data chunk isn’t necessary to include for png files using a truecolor format, but is necessary for indexed color formats.)

If I’m working on something like a pokemon rom hack, then the tools used to compile projects for the NDS / GBA (and most likely any hardware older then that) would require me to ensure that any PNG files I use in the project include a PLTEdata chunk. (Otherwise it won’t be able to compile)

Currently in Pixieditor, if you try to edit a png file, even one that allready includes the PLTE data chunk, there is no way that I know of to save / export the image in a format that includes a PLTE data chunk. Not being able to export the image in an indexed color format, means I can’t use pixieditor for projects like that, since any edit I make would remove the pallet information from the file.

I can understand the confusion here, i’m not asking for indexed color pallets because I need an easier way to swap out all the pixels of a specific color on the canvas, what I do need would to be able to assign each pixel to a specific index and then assign each index a color, (which may or may not be different colors.) I understand the terminology is a bit confusing, but the key difference is the ability to sort the color pallet and, (most importantly) to be able to store the specific order of that color pallet in the exported file. see gimp’s 8.34. Rearrange Colormap menu.

Note that swapping the order of the color pallet, dose not change the visual appearance of the image itself, but internally dose change the byte assigned to each pixel in the final png file. This is important since some games might assign special meaning to specific color indexes, like treating any pixel with color index 0 as transparent.

Not something that would be included in this specific “proposal” but In the long run I think it would be cool if PixiEditors node and graph system could one day also be used to assign special meaning to different color index’s. I could see a use for example in applying an animated Noise filter to all pixels with a specific color index. (as apposed to all pixels of a specific color ).

Ah, I think I understand now. I was aware how indexing works in technical terms, but wasn’t aware of PLTE part in PNG. I can definately see how this is required for those limited use cases.

I can definately see this as part of PixiEditor, although it would require extensive design to implement correctly with all parts of PixiEditor in mind.

Thank you @mmzero @NPO for detailed explanation. I am optimistic about pushing this proposal further, although can’t say now in which version it may be implemented.

2 Likes

Nice! I hope it can get there at some point :–)