Any way to reduce color depth to a pre-made palette?

Ask for help and post your question on how to use XnView Classic.

Moderators: helmut, XnTriq, xnview

Post Reply
User avatar
NM64
Posts: 80
Joined: Sun Aug 05, 2007 7:17 pm

Any way to reduce color depth to a pre-made palette?

Post by NM64 »

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
User avatar
Clo
XnThusiast
Posts: 4441
Joined: Sun Oct 17, 2004 4:57 am
Location: Bordeaux, France
Contact:

Poor workaround…

Post by Clo »

:arrow: nintendomaniac64

:) Hello !

• 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 8)

• 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… :|

:mrgreen: KR
Claude
Clo
Old user ON SELECTIVE STRIKE till further notice
User avatar
NM64
Posts: 80
Joined: Sun Aug 05, 2007 7:17 pm

Post by NM64 »

Well, the palette file I'm using is one I made within XnView. I just reduced a random image to 16 colors, then edited and saved the palette.
User avatar
Clo
XnThusiast
Posts: 4441
Joined: Sun Oct 17, 2004 4:57 am
Location: Bordeaux, France
Contact:

Non random palette…

Post by Clo »

:arrow: nintendomaniac64

:) Hello !
…I just reduced a random image to 16 colors, then edited and saved the palette.
• I tested doing so, it works indeed when loading the saved palette as “Windows Palette” for another image.

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

:mrgreen: KR
Claude
Clo
Old user ON SELECTIVE STRIKE till further notice
Post Reply