Jump to content


How to create high quality palleted animations?

pallete animation npc character

  • Please log in to reply
2 replies to this topic

#1 Gamemacik

  • Member
  • 7 posts

Posted 18 May 2020 - 11:21 PM

i try to create new palleted npc animation, the pallete is same as for character animations in BG2:EE.
I ran into several problems:
1. Resizing (resampling, downsampling, to make it smaller) animation gives very poor results, same with NearInfinity, Photoshop, or other tools if Nearest Neighbor algorithm is used.
2. When i used bicubic algorithm i got much better results but this method will change colors of pixels which are restricted by pallete, so when resized image is palleted again pixel colors are messed, eg, Hair color pixels appears somewhere at body skin (colors [15,A-H] on picture), or on Minor color clothes of npc (colors [15,I-P] on picture).
I render animation from 3DSmax with turned OFF Antialiasing and Filter Maps so i get exactly same colors as are in the pallete. Exported NPC is same size as the palleted texture, so high of npc and texture is 1:1, note: the texture is already palleted with same colors which are required for palleted characters.
NPC is resized from 106x224px to 38x80px.
3. Palleted animations in  BG2:EE use some colors from pallete which are used for both colors eg. "Minor" and "Skin"  colors, when we move color customization slider in the game. Color pixels will change if first or second slider is moved (1 color belongs to two sliders, or two sliders use same color...), these colors are used for smoothing, transitions between colors (256 colors, 8-bit images supports Nearest Neighbor algorithm only). I do not know how they got these transition colors to correct place (doing it manually with pencil.., 1000 slides that would take long time...fuh).

yPrZqHXl.png np3jstil.png
Following table shows other colors which are not connected to any slider, first row is color in the pallete an second row, how are colors displayed in the game.


Also IE animation are not perfect eg. CHMB1G17.bam, eyes lulz :D

Edited by Gamemacik, 25 May 2020 - 01:44 AM.

#2 Sam.

  • Modder
  • 1121 posts

Posted 20 May 2020 - 04:52 PM

I'm not sure I quite follow everything you are asking, but have you tried using BAM Resizer to resize BAMs?  Also see 1pp New developer resources for some useful notes as well as my rewrite of Erephine's Palette Generator (described in that same topic).  You can find a list of the different assignable color "locations" on the IESDP, but those aren't my favorite descriptions.  Presumably if the same pixel is modified by changing the colors assigned to more than one gradient, it belongs to one of the mixed gradients and not one of the primary seven.  I do not recall if I have personally observed this behavior in the games, but I haven't studied the EEs that closely.  As far as tricking your particular image editor into using the appropriate gradients in the palette, that's program specific and I don't have much advice.  Gwendolyne might.

"Ok, I've just about had my FILL of riddle asking, quest assigning, insult throwing, pun hurling, hostage taking, iron mongering, smart-arsed fools, freaks, and felons that continually test my will, mettle, strength, intelligence, and most of all, patience! If you've got a straight answer ANYWHERE in that bent little head of yours, I want to hear it pretty damn quick or I'm going to take a large blunt object roughly the size of Elminster AND his hat, and stuff it lengthwise into a crevice of your being so seldom seen that even the denizens of the nine hells themselves wouldn't touch it with a twenty-foot rusty halberd! Have I MADE myself perfectly CLEAR?!"

--<CHARNAME> to Portalbendarwinden


___________Old pen and paper modules of the 70s and 80s.___________

CA Forums CA Homepage

#3 Gamemacik

  • Member
  • 7 posts

Posted 21 May 2020 - 03:06 AM

I tested BAMresizer, it gives same bad results as NearInfinity or Photoshop, i guess it also uses Nearest Neighbor algorithm. Nearest Neighbor is incredible bad for very small animations where every pixel and color is very important.
I have already seen Palette Generator, but i do not need to generate pallete, pallete its already in the game, question was more if anyone was successful with creation of custom made pelleted NPC with pallete posted above.

This was not clear? "I do not know how they got these transition colors to correct place" These colors works like antialiasing probably.

Edited by Gamemacik, 21 May 2020 - 08:01 AM.

Also tagged with one or more of these keywords: pallete, animation, npc, character