I am looking for some way to reduce an image's color depth to only the colors in a pre-made palette file. I cannot load the palette after reducing colors because it will not adapt it and instead just changes the colors of the old palette to the new color of the same index number.
I hope that made sense. XD
Any way to reduce color depth to a pre-made palette?
Moderators: helmut, XnTriq, xnview
Poor workaround…


• AFAIK, that's not quite possible (yet ?) with XnView… Maybe a bit aside, just a poor workaround
which could (perhaps) do the trick in some cases: Just use GFIE, a gratis icon editor enhanced to edit
PNG - JPG - BMP… images too, up to 1024² (guaranteed) and a few more.
It has a built-in feature which reduces the colour depth to the real count of colours the image contains.
- For instance, a PNG 24 BPP containing only 120 colours is displayed, processed and saved as 8 BPP.
However, the pastel hues which don't belong to the standard 256-colour palette are respected and rendered alright…
Available from THIS PAGE

• Or else, you may load a palette then from the Image menu >> Edit colormap >> [Load…] button,
but it's valid for images up to 8 BPP, and I confess that I don't know how to write such a palette file…
… Some *.pal files are text, some aren't… and the programme doesn't provide any convenient template, I guess

- You may save the colour contents of an image from the same box, but under four different palette-formats,
and the right one for XnView is unknown (at least, for me). Should be "Windows palette"… ?
Note : I made a quick test, "Windows palette" are binary files…


Claude
Clo
Old user ON SELECTIVE STRIKE till further notice •
Non random palette…


• I tested doing so, it works indeed when loading the saved palette as “Windows Palette” for another image.…I just reduced a random image to 16 colors, then edited and saved the palette.
• The problem is that we can't get predefined palettes directly, except by drawing a set of template images
(one for each palette) then save them from the Edit Palette box…
• I sent a note to the author of GFIE, maybe he could have a clue about that;
I mean: A way to define palettes directly, or use some already existing ones in Win or elsewhere.

Claude
Clo
Old user ON SELECTIVE STRIKE till further notice •