:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::
Do you want to advertise at Project Perfect Mod. Find out how to do it HERE.

The time now is Wed Jan 17, 2018 5:26 am
All times are UTC + 0
 Forum index » Featured Tools » OS SHP Builder » Suggestions
Alphaimage import
Moderators: stucuk
Post new topic   Reply to topic Page 1 of 1 [5 Posts] View previous topic :: View next topic
Author Message
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Fri Oct 01, 2010 11:14 pm    Post subject:   Alphaimage import
Subject description: directly mapping greyscale color value to palette color index
Reply with quote

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

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant, 1 Scrin unit, 1 GDI building

Tools
Image Shaper______TMP Shop______C&C Executable Modifier

Back to top
View user's profile Send private message
Banshee
Supreme Banshee


Joined: 15 Aug 2002
Location: Brazil

PostPosted: Sat Oct 02, 2010 2:08 pm    Post subject: Reply with quote

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.

Back to top
View user's profile Send private message Visit poster's website Skype Account
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Thu Oct 07, 2010 9:04 am    Post subject: Reply with quote

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

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant, 1 Scrin unit, 1 GDI building

Tools
Image Shaper______TMP Shop______C&C Executable Modifier

Back to top
View user's profile Send private message
Nyerguds
General


Joined: 24 May 2004
Location: Flanders (Be) Posts:300000001

PostPosted: Thu Oct 07, 2010 8:43 pm    Post subject: Reply with quote

Lin Kuei Ominae wrote:
I tried already a JASC palette with 256 colors from 0,0,0 1,1,1 - 256,256,256.

Shouldn't that be 0,0,0 to 255,255,255? 256 kinda exceeds the byte value.
_________________

Back to top
View user's profile Send private message Visit poster's website Skype Account
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Thu Oct 07, 2010 9:39 pm    Post subject: Reply with quote

yep, of course. Embarassed
_________________
SHP Artist of Twisted Insurrection:  Nod buildings

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant, 1 Scrin unit, 1 GDI building

Tools
Image Shaper______TMP Shop______C&C Executable Modifier

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [5 Posts] View previous topic :: View next topic
 Forum index » Featured Tools » OS SHP Builder » Suggestions
Jump to:  
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
Quick Reply
Username:


If you are visually impaired or cannot otherwise answer the challenges below please contact the Administrator for help.


Write only one of the following words: Brotherhood, unity, peace! 

 
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


Powered by phpBB © phpBB Group

Wildcard SSL Certificates
[ Time: 0.2322s ][ Queries: 12 (0.1116s) ][ Debug on ]