Re: Doom2 pics with Quake palette

Rob Shields (rshields@eve.net)
Mon, 10 Jun 1996 12:46:00 -0400

Date: Mon, 10 Jun 1996 12:46:00 -0400
From: Rob Shields <rshields@eve.net>
To: quake-dev@gamers.org
Subject: Re: Doom2 pics with Quake palette

Bernd Kreimeier wrote:

>
> [ another full quote deleted - b. ]
>
> Does anybody know what kind of palette matching algorithm DMVIEW
> actually uses? Is the source available (the author around)?
>
> b.

DMView did not do the palette matching, I did. My algorithm extracted the
Quake palette from GFX.WAD, and the Doom2 palette from the first bitmap it
scanned. I then made a look up table between the two palettes as to
which entries in the Doom2 palette corresponded to which entries in the
Quake palette. If there were no exact matches, I found the closest one by
using an adapted version of the distance formula,
(((r2-r1)^2)+((g2-g1)^2)+((b2-b1)^2))^(1/2). Then I just went through the
bitmaps created by DMView, replaced the palette with the Quake palette,
then went through the actual picture data and replaced the old bytes with
the corresponding new values as defined in the look up table. So I now
have 2288 .BMP files which use the Quake test palette. I wrote the program
in QuickBASIC 4.5 for ease of debugging, and I can post the source
code here if you want.

Rob Shields