Posted: Fri Oct 01, 2010 11:14 pm Post subject:
Alphaimage import
Subject description: directly mapping greyscale color value to palette color index
I tried to create a new palette with the colors 0,0,0-255,255,255 but due to the restriction that a palette can use only multiples of 4 as the color value this isn't possible (also described here)
The problem now is, that due to the palette restriction you can't create an alphalight using the full color range.
During the conversion the SHP would always have 4 different shades of grey converted into a single color in the palette.
e.g. 4 pixel with the colors 0,0,0 1,1,1 2,2,2 and 3,3,3 in the PNG would be all converted into plain black, as the palette can't contain such small color differences. Every palette can only contain colors in a multiple of 4 like 0,0,0 4,4,4 8,8,8 12,12,12 etc.
So it would be good if the SHP builder would have an inbuild alphapal, that doesn't follows the palette restriction and has a full greyscale range from 0,0,0 to 255,255,255.
Or when importing an alphaimage, another Colour Conversion Method could be added, that ignores the palette and directly maps the color of a pixel (red channel could be considered only) directly to the index of a color in the palette. e.g. a pixel with color 123,123,123 would be mapped to color index 123 in the palette. _________________ SHP Artist of Twisted Insurrection: Nod buildings
Also Known As: banshee_revora (Steam) Joined: 15 Aug 2002 Location: Brazil
Posted: Sat Oct 02, 2010 2:08 pm Post subject:
OS SHP Builder works with the C&C .pal files which, unfortunately, only stores 256 colours where each channel (red, green, blue) only hold 6 bits (0-63). That's really a limitation of how C&C game engines work (from TD to RA2).
In order to bypass this limitation, save your palette as .JASC palette and load it (as JASC palette) at OS SHP Builder.
But that won't do a difference for the game, which still deals with 6bits colour channels only. QUICK_EDIT
I tried already a JASC palette with 256 colors from 0,0,0 1,1,1 - 256,256,256. But this doesn't work too, because SHP Builder gives the error message
SHP Builder wrote:
'$0014C104128' is not a valid integer value
when i try to import the image and use the JASC palette.
Banshee wrote:
But that won't do a difference for the game, which still deals with 6bits colour channels only.
On the contrary. Ingame the alphapalette uses the complete 256 color range of the palette from color index 0 to index 255.
Because the game uses the color index of the pixel to determine the light increase and not the color value stored in some kind of alphapalette, which doesn't exist and is some kind of hardcoded into the engine.
e.g. if a pixel has color index 154, the game will increase the light at this point by 27 points (154-127=27), even if a color value of 154,154,154 can't be stored in a palette and the next possible 6bit colors are 152,152,152 and 156,156,156.
The problem is that during the conversion, only every 4th color is used since only every 4th color has a different shade of grey. Due to the limitation of 6 bits for each channel, a grey palette can have only 63 shades of grey which have to be mapped on the 256 colors, thus 4 colors have to use the same shade of grey.
However i now got it work by copying the image to clipboard and then inserting it into an already open alphaimage shp. Because when i load a palette with an open SHP, i can successfully use the JASC palette. Only during import Image->SHP the JASC palette with the full 256 grey color values makes some trouble. _________________ SHP Artist of Twisted Insurrection: Nod buildings
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum