Palshift Analyzer v2.00 (public v1.00)
Moderator: Paul Siramy
- Nefarius
- Cherub
- Posts: 11607
- Joined: Sat Jun 15, 2002 8:13 pm
- Location: Where the blood forever rains
- Contact:
Palshift Analyzer v2.00 (public v1.00)
Download: dload.php?action=file&file_id=1451
Source: dload.php?action=file&file_id=1452
PalAnalyzer
v2.00 (public release 1.00)
By Nefarius
Whats this?
-----------
This tool allows you to create palshift.dat files with the same precision
blizzard created their own (or at least close to that precision and ease).
Unlike PalShifter you don't have to undergo the mundane task of manually changing
every single entry via long trial and error sessions.
PalAnalyzer allows you to edit the palette in an image editor of choice,
then save the result as PCX and let the tool compile it into a D2 palette again,
this offers you any form of image manipulation, be it colorization,
channel mixing and whatnot to give your monsters some nicer colors.
But thats not all, PalAnalyzer can also export palettes to *.TXT format,
so you can change specific indexes in a spreadsheet program,
or quickly copy/paste palettes without the need of a hex editor.
Notes
-----
This program requires Allegro v4.2
All files must be inside the same folder (duh)
Disclaimer
----------
I don't take any responsibility regarding anything whatsoever that happens
throughout usage (or lack of such) of this application, it's your fault,
live with it or die.
Extracting a Palette Into a TXT Table
-------------------------------------
In Analyzer.ini change the mode to dat2txt, specify the name of the
PalShift.dat file in the input line, and the desired name for the
produced txt file in the output line (both with extension).
Then simply launch the program.
Compiling a TXT Table into a Palette
------------------------------------
In Analyzer.ini change the mode to txt2dat, specify the name of
the TXT table in the input line, and the desired name for
the produced palette file in the output line (both with extension).
Then simply launch the program.
Extracting a Palette into PCX format
------------------------------------
At any point during execution, if you hit F2, the currently loaded
palette will be extracted into an array of PCX files with the name
following this syntax: <base_file_name> <underscore> <index> (for example
palshift3_03.pcx).
Compiling a Palette from PCX files
----------------------------------
After you extracted a palette and edited it in a image editor,
you must apply the D2-palette to it (included with this tool for Paintshop Pro (psp.pal),
for a Photoshop palette see our file center), while PalAnalyzer will attempt to
find the nearest color, it's not going to 'work as expected'
most of the time if you don't apply the D2-palette. After the images are done
open Analyzer.ini, change the mode to pcx2txt, and change the input line to the 'prefix'
of the images (that is, if you called the images palshift3_00.pcx
throughout palshift3_07.pcx (note: you must start with 00), then use the prefix "palshift3"
(without the quotes of course). Now launch the program.
PalAnalyzer will automatically create both a *.TXT table and a *.DAT for you.
NOTE: If you experience problems, try to save the
PCX as 16BIT instead of 8BIT after applying the D2 palette.
NOTE: You might notice that PalAnalyzer will 'shift' some indexes that are unchanged,
these indexes in fact point to non-existant colors that are not part of the units palette.
(These colors are act specific).
Other Stuff
-----------
By default shifted indexes are shown in magenta, to reveal shifted indexes press F1.
Use left and right keys to navigate throughout the sub palettes.
Source: dload.php?action=file&file_id=1452
PalAnalyzer
v2.00 (public release 1.00)
By Nefarius
Whats this?
-----------
This tool allows you to create palshift.dat files with the same precision
blizzard created their own (or at least close to that precision and ease).
Unlike PalShifter you don't have to undergo the mundane task of manually changing
every single entry via long trial and error sessions.
PalAnalyzer allows you to edit the palette in an image editor of choice,
then save the result as PCX and let the tool compile it into a D2 palette again,
this offers you any form of image manipulation, be it colorization,
channel mixing and whatnot to give your monsters some nicer colors.
But thats not all, PalAnalyzer can also export palettes to *.TXT format,
so you can change specific indexes in a spreadsheet program,
or quickly copy/paste palettes without the need of a hex editor.
Notes
-----
This program requires Allegro v4.2
All files must be inside the same folder (duh)
Disclaimer
----------
I don't take any responsibility regarding anything whatsoever that happens
throughout usage (or lack of such) of this application, it's your fault,
live with it or die.
Extracting a Palette Into a TXT Table
-------------------------------------
In Analyzer.ini change the mode to dat2txt, specify the name of the
PalShift.dat file in the input line, and the desired name for the
produced txt file in the output line (both with extension).
Then simply launch the program.
Compiling a TXT Table into a Palette
------------------------------------
In Analyzer.ini change the mode to txt2dat, specify the name of
the TXT table in the input line, and the desired name for
the produced palette file in the output line (both with extension).
Then simply launch the program.
Extracting a Palette into PCX format
------------------------------------
At any point during execution, if you hit F2, the currently loaded
palette will be extracted into an array of PCX files with the name
following this syntax: <base_file_name> <underscore> <index> (for example
palshift3_03.pcx).
Compiling a Palette from PCX files
----------------------------------
After you extracted a palette and edited it in a image editor,
you must apply the D2-palette to it (included with this tool for Paintshop Pro (psp.pal),
for a Photoshop palette see our file center), while PalAnalyzer will attempt to
find the nearest color, it's not going to 'work as expected'
most of the time if you don't apply the D2-palette. After the images are done
open Analyzer.ini, change the mode to pcx2txt, and change the input line to the 'prefix'
of the images (that is, if you called the images palshift3_00.pcx
throughout palshift3_07.pcx (note: you must start with 00), then use the prefix "palshift3"
(without the quotes of course). Now launch the program.
PalAnalyzer will automatically create both a *.TXT table and a *.DAT for you.
NOTE: If you experience problems, try to save the
PCX as 16BIT instead of 8BIT after applying the D2 palette.
NOTE: You might notice that PalAnalyzer will 'shift' some indexes that are unchanged,
these indexes in fact point to non-existant colors that are not part of the units palette.
(These colors are act specific).
Other Stuff
-----------
By default shifted indexes are shown in magenta, to reveal shifted indexes press F1.
Use left and right keys to navigate throughout the sub palettes.
Last edited by Nefarius on Sun Apr 08, 2007 10:32 pm, edited 1 time in total.
''(...) The game can basically be considered unhackable. '' - Blizzard Entertainment (30th May 2000)
Black Omen Productions | MetalStorm: Progress Report | Screenshots
Black Omen Productions | MetalStorm: Progress Report | Screenshots
- Paul Siramy
- Principality
- Posts: 2828
- Joined: Sat May 25, 2002 2:39 pm
- Location: La Garenne Colombes (near Paris)
- Contact:
Re: Palshift Analyzer v2.00 (public v1.00)
Interesting tool. But some questions.
* when remaping the pcx new palette into the Diablo II regular palette, do you preserve the index 0 to stay 0, whatever the new color it is ?
* when remaping new palette into regular palette, do you handle act-dependant colors ? I supose that since you're using the palette "units.dat" you indirectly handle them, but I wanted a confirmation.
* I check the source code. I see that your formula to find the nearest color is basic. It don't use the fact that human eyes are more sensible to green, than to red, and than to blue. Do you just forget it, or was it on purpose ?
* by incorectly using the "units.dat" as the input palette (mode=dat2txt ; input=units.dat ; output=units.txt), I find some "-1" in "units.txt", looks like a bug to have values outside the range [0;255] tough.
* I didn't understand clearly your code when it read the 768 bytes of a pcx 's palette. Are you aware that after all the header, and pixel datas in the pcx file, and right before the palette at the end of the file, there's a "magic" byte to skip ?
Just as a bonus, here's a function I used in one of my program, to find the nearest (best fit) color within a palette, given an input color components :
It don't use floating point arithmetics, and no sqrt() nor pow() functions, so it's quick. And it handles the eye properties : luminance = 30% red + 60% Green + 10% Blue. The eye is more sensible to luminance than the actual color. Well... you need to make your own test anyway Normally the coefficients are R=0.299, G=0.587 and B=0.114.
* when remaping the pcx new palette into the Diablo II regular palette, do you preserve the index 0 to stay 0, whatever the new color it is ?
* when remaping new palette into regular palette, do you handle act-dependant colors ? I supose that since you're using the palette "units.dat" you indirectly handle them, but I wanted a confirmation.
* I check the source code. I see that your formula to find the nearest color is basic. It don't use the fact that human eyes are more sensible to green, than to red, and than to blue. Do you just forget it, or was it on purpose ?
* by incorectly using the "units.dat" as the input palette (mode=dat2txt ; input=units.dat ; output=units.txt), I find some "-1" in "units.txt", looks like a bug to have values outside the range [0;255] tough.
* I didn't understand clearly your code when it read the 768 bytes of a pcx 's palette. Are you aware that after all the header, and pixel datas in the pcx file, and right before the palette at the end of the file, there's a "magic" byte to skip ?
Just as a bonus, here's a function I used in one of my program, to find the nearest (best fit) color within a palette, given an input color components :
Code: Select all
int my_bestfit_color(PALETTE pal, int r, int g, int b)
{
int i, min_idx;
long dr, dg, db, min_dist, curr_dist;
// init
dr = r - pal[0].r;
dg = g - pal[0].g;
db = b - pal[0].b;
min_dist = dr*dr*76 + dg*dg*150 + db*db*28;
min_idx = 0;
for (i=1; i < 256; i++)
{
dr = r - pal[i].r;
dg = g - pal[i].g;
db = b - pal[i].b;
curr_dist = dr*dr*76 + dg*dg*150 + db*db*28;
if (curr_dist < min_dist)
{
min_dist = curr_dist;
min_idx = i;
}
}
return min_idx;
}
Last edited by Paul Siramy on Tue Apr 10, 2007 12:02 am, edited 2 times in total.
DT1 Tools - DS1 Editor - MPQ list file - Extracting D2 Animation - Adding ANY Monsters and ANY Objects to a DS1 - New monster color variations from scratch
In development since 16 Feb 2012 : MergeDCC v2
In development since 16 Feb 2012 : MergeDCC v2
- Nefarius
- Cherub
- Posts: 11607
- Joined: Sat Jun 15, 2002 8:13 pm
- Location: Where the blood forever rains
- Contact:
Re: Palshift Analyzer v2.00 (public v1.00)
Didn't do checks on that part, but AFAIK D2 will always use color 0 for palette index 0, even if it is shifted, at least I think I saw that when looking at the palshift code.* when remaping the pcx new palette into the Diablo II regular palette, do you preserve the index 0 to stay 0, whatever the new color it is ?
In units.dat all the act dependant colors are pure black like color 0, the tool maps them to color 0 (as they don't occur inside any animation that uses palshift, aka monsters - no monster is act specific), this shouldn't matter.* when remaping new palette into regular palette, do you handle act-dependant colors ? I supose that since you're using the palette "units.dat" you indirectly handle them, but I wanted a confirmation.
Not on purpose, it's the best I could get to with my experimenting, I'll play around with your code and include this to improve it Thanks.* I check the source code. I see that your formula to find the nearest color is basic. It don't use the fact that human eyes are more sensible to green, than to red, and than to blue. Do you just forget it, or was it on purpose ?
-1 means that 'no shift' occurred* by incorectly using the "units.dat" as the input palette (mode=dat2txt ; input=units.dat ; output=units.txt), I find some "-1" in "units.txt", looks like a bug to have values outside the range [0;255] tough.
The .txt file lists only shifted indexes with a number, unshifted ones are -1
It doesn't read the palette from the PCX files, it reads units.dat, it checks if the file is exactly 768 bytes (aka 256 pairs of 3 RGB values).* I didn't understand clearly your code when it read the 768 bytes of a pcx 's palette. Are you aware that after all the header, and pixel datas in the pcx file, and right before the palette at the end of the file, there's a "magic" byte to skip ?
Last edited by Nefarius on Tue Apr 10, 2007 12:30 am, edited 2 times in total.
''(...) The game can basically be considered unhackable. '' - Blizzard Entertainment (30th May 2000)
Black Omen Productions | MetalStorm: Progress Report | Screenshots
Black Omen Productions | MetalStorm: Progress Report | Screenshots
Re: Palshift Analyzer v2.00 (public v1.00)
Would it be possible to add a feature: importing .trn files from D1?
Do the right thing. It will gratify some people and astonish the rest.
~ Mark Twain
Run Diablo II in any version for mods: tutorial
The Terms of Service!! Know them, abide by them, and enjoy the forums at peace.
The Beginner's Guide v1.4: (MS Word | PDF) || Mod Running Scripts || TFW: Awakening
~ Mark Twain
Run Diablo II in any version for mods: tutorial
The Terms of Service!! Know them, abide by them, and enjoy the forums at peace.
The Beginner's Guide v1.4: (MS Word | PDF) || Mod Running Scripts || TFW: Awakening
- Nefarius
- Cherub
- Posts: 11607
- Joined: Sat Jun 15, 2002 8:13 pm
- Location: Where the blood forever rains
- Contact:
Re: Palshift Analyzer v2.00 (public v1.00)
Hmm, yes that would indeed be very desireable. I'll see if I manage to pull that off. To do this I need to know what colors the standard D1 units palette contained, the rest shouldn't be too complicated (except maybe for the fact D1 unit palettes didn't contain as much green as D2 palettes, and vice versa, D2 palettes are rather devoid of yellow).
Last edited by Nefarius on Tue Apr 10, 2007 4:48 am, edited 2 times in total.
''(...) The game can basically be considered unhackable. '' - Blizzard Entertainment (30th May 2000)
Black Omen Productions | MetalStorm: Progress Report | Screenshots
Black Omen Productions | MetalStorm: Progress Report | Screenshots
- Alkalund
- Throne
- Posts: 7597
- Joined: Sun May 26, 2002 5:54 pm
- Location: Toronto, Ontario, Canada
- Contact:
Just spotted this thread on the news, nice little program.
In case you ever feel like playing around and pushing this to the next level of accuracy, consider the CIEDE2000 color difference formula; Paul might remember it, from back in 2004 when I did some mathematical studies on the D2 palettes.Just as a bonus, here's a function I used in one of my program, to find the nearest (best fit) color within a palette, given an input color components :
- Nefarius
- Cherub
- Posts: 11607
- Joined: Sat Jun 15, 2002 8:13 pm
- Location: Where the blood forever rains
- Contact:
Re: Palshift Analyzer v2.00 (public v1.00)
Yea, id like improving the code
''(...) The game can basically be considered unhackable. '' - Blizzard Entertainment (30th May 2000)
Black Omen Productions | MetalStorm: Progress Report | Screenshots
Black Omen Productions | MetalStorm: Progress Report | Screenshots
-
- Posts: 5
- Joined: Thu Jul 05, 2018 12:58 pm
Re: Palshift Analyzer v2.00 (public v1.00)
is not working your app
-
- Posts: 5
- Joined: Thu Jul 05, 2018 12:58 pm
Re: Palshift Analyzer v2.00 (public v1.00)
salut ma in plm e cineva aici care stie sa faca modding sau site asta e pus asa la misto aici ....
unde plm sunt admini cand ai nevoie de ei?
le-am lasat si mesaje si nu raspunde nimeni
unde plm sunt admini cand ai nevoie de ei?
le-am lasat si mesaje si nu raspunde nimeni
Re: Palshift Analyzer v2.00 (public v1.00)
Please avoid double posting (use 'edit' instead) and write in english as we are everyone from different nations, so we would have hard times in understanding what you need
Terms of Service
My tutorials:
AIs:
Fixing the Shadow Master's AI
The Shadow Master's AI Compendium
The Shadow Warrior's AI Compendium
The DruidBear's AI Compendium
The DruidWolf's AI Compendium
The Vines AI Compendium
Use every AI as Minion for the Player [Thanks to Necrolis]
Adding simple commands to the Shadow Master's AI
Skills:
Fixing SrvDoFunc 49
Creating a proper summoning skill for enemy monsters
Revive super uniques and bosses
Misc:
Changing reanimated monsters life span [thanks to Necrolis]
My resources:
Ogodei's Diablo I Monster Pack - Final
Ogodei's Diablo I Item Pack v1.00
Ogodei's Autumnal Act I
My tutorials:
AIs:
Fixing the Shadow Master's AI
The Shadow Master's AI Compendium
The Shadow Warrior's AI Compendium
The DruidBear's AI Compendium
The DruidWolf's AI Compendium
The Vines AI Compendium
Use every AI as Minion for the Player [Thanks to Necrolis]
Adding simple commands to the Shadow Master's AI
Skills:
Fixing SrvDoFunc 49
Creating a proper summoning skill for enemy monsters
Revive super uniques and bosses
Misc:
Changing reanimated monsters life span [thanks to Necrolis]
My resources:
Ogodei's Diablo I Monster Pack - Final
Ogodei's Diablo I Item Pack v1.00
Ogodei's Autumnal Act I
Re: Palshift Analyzer v2.00 (public v1.00)
Hello
Excellent but link is dead
Excellent but link is dead
Re: Palshift Analyzer v2.00 (public v1.00)
I wanted to modify monster palette !