I don't think there's any utility to compile/decompile alpha blending tables, so I made my own
Although only console mode for now
AlphaEdit: [attach=4468]
Tileset palette pack (including alpha palettes): [attach=4469]
AlphaEdit by Clokr_
Usage:
AlphaEdit c/d tileset.wpe alpha.wpe alpha.pcx [params]
c Compile alpha.pcx from tileset.wpe and alpha.wpe
d Try to decompile alpha.wpe from tileset.wpe and alpha.pcx
AlphaEdit m result.wpe pal1.wpe pal2.wpe ...
m Calculate the mean of the .wpe palettes
Compile options:
height:n Height of the resulting pcx palette (def 255)
Decompile options:
alpharange:n,m Range of colors used to calculate the alpha value
(def 0,255)
alphatol:n Only colors whose components differ more than n will
be used to calculate alpha (def 50)
clrtol:n If alpha is greater than 1-1/n then the black color (0)
will be copied to the resulting alpha palette (def 255)
The utility has two main modes: Compile and Decompile.
Compile mode:Generates a alpha blending table in .pcx format from the tileset .wpe palette and a secondary alpha palette in .wpe format which also contains alpha information. I'm not sure whether there is any utility which allows the edition of the alpha information of a .wpe palette, but if there is not you can bug farty until he decides to update PalEdit
.
The mode is pretty straightforward. Also note that the color 0 of a alpha palette is not used (transparent) and will be ignored while translating the palette to the .pcx table.
Decompile mode:In this mode AlphaEdit will *try* to extract the secondary alpha palette from the data in the tileset palette (.wpe) and the alpha blending table (.pcx). This is not always possible because some information is lost while creating the blending table, so some resulting colors might look glitchy (specially the ones with very high alpha values, although those will become almost transparent so the result will still be good if a new alpha blending table is compiled from these palettes).
The options are internal parameters for the decompression algorithm, which won't usually have to be changed. You can play with them to try to archieve better results.
Extra modes:
Mean mode:AlphaEdit will calculate the average palette from a list of .wpe palettes. This mode might be usefull to merge the decompiled alpha palettes.
If anyone wants to decompile all the tileset palettes at once, uncompress all the .wpe and .pcx tileset files into a dir (make sure they still have the original path .\tileset\ashworld\bexpl.pcx, etc), copy AlphaEdit into the dir and copy this code into a .bat file:
Collapsable Box
AlphaEdit d ".\tileset\ashworld.wpe" ".\tileset\ashworld\bexpl.wpe" ".\tileset\ashworld\bexpl.pcx"
AlphaEdit d ".\tileset\ashworld.wpe" ".\tileset\ashworld\bfire.wpe" ".\tileset\ashworld\bfire.pcx"
AlphaEdit d ".\tileset\ashworld.wpe" ".\tileset\ashworld\blue.wpe" ".\tileset\ashworld\blue.pcx"
AlphaEdit d ".\tileset\ashworld.wpe" ".\tileset\ashworld\dark.wpe" ".\tileset\ashworld\dark.pcx"
AlphaEdit d ".\tileset\ashworld.wpe" ".\tileset\ashworld\gfire.wpe" ".\tileset\ashworld\gfire.pcx"
AlphaEdit d ".\tileset\ashworld.wpe" ".\tileset\ashworld\light.wpe" ".\tileset\ashworld\light.pcx"
AlphaEdit d ".\tileset\ashworld.wpe" ".\tileset\ashworld\ofire.wpe" ".\tileset\ashworld\ofire.pcx"
AlphaEdit d ".\tileset\ashworld.wpe" ".\tileset\ashworld\orange.wpe" ".\tileset\ashworld\orange.pcx"
AlphaEdit d ".\tileset\ashworld.wpe" ".\tileset\ashworld\trans50.wpe" ".\tileset\ashworld\trans50.pcx"
AlphaEdit d ".\tileset\badlands.wpe" ".\tileset\badlands\bexpl.wpe" ".\tileset\badlands\bexpl.pcx"
AlphaEdit d ".\tileset\badlands.wpe" ".\tileset\badlands\bfire.wpe" ".\tileset\badlands\bfire.pcx"
AlphaEdit d ".\tileset\badlands.wpe" ".\tileset\badlands\blue.wpe" ".\tileset\badlands\blue.pcx"
AlphaEdit d ".\tileset\badlands.wpe" ".\tileset\badlands\dark.wpe" ".\tileset\badlands\dark.pcx"
AlphaEdit d ".\tileset\badlands.wpe" ".\tileset\badlands\gfire.wpe" ".\tileset\badlands\gfire.pcx"
AlphaEdit d ".\tileset\badlands.wpe" ".\tileset\badlands\light.wpe" ".\tileset\badlands\light.pcx"
AlphaEdit d ".\tileset\badlands.wpe" ".\tileset\badlands\ofire.wpe" ".\tileset\badlands\ofire.pcx"
AlphaEdit d ".\tileset\badlands.wpe" ".\tileset\badlands\orange.wpe" ".\tileset\badlands\orange.pcx"
AlphaEdit d ".\tileset\badlands.wpe" ".\tileset\badlands\trans50.wpe" ".\tileset\badlands\trans50.pcx"
AlphaEdit d ".\tileset\desert.wpe" ".\tileset\desert\bexpl.wpe" ".\tileset\desert\bexpl.pcx"
AlphaEdit d ".\tileset\desert.wpe" ".\tileset\desert\bfire.wpe" ".\tileset\desert\bfire.pcx"
AlphaEdit d ".\tileset\desert.wpe" ".\tileset\desert\blue.wpe" ".\tileset\desert\blue.pcx"
AlphaEdit d ".\tileset\desert.wpe" ".\tileset\desert\dark.wpe" ".\tileset\desert\dark.pcx"
AlphaEdit d ".\tileset\desert.wpe" ".\tileset\desert\gfire.wpe" ".\tileset\desert\gfire.pcx"
AlphaEdit d ".\tileset\desert.wpe" ".\tileset\desert\light.wpe" ".\tileset\desert\light.pcx"
AlphaEdit d ".\tileset\desert.wpe" ".\tileset\desert\ofire.wpe" ".\tileset\desert\ofire.pcx"
AlphaEdit d ".\tileset\desert.wpe" ".\tileset\desert\orange.wpe" ".\tileset\desert\orange.pcx"
AlphaEdit d ".\tileset\desert.wpe" ".\tileset\desert\trans50.wpe" ".\tileset\desert\trans50.pcx"
AlphaEdit d ".\tileset\ice.wpe" ".\tileset\ice\bexpl.wpe" ".\tileset\ice\bexpl.pcx"
AlphaEdit d ".\tileset\ice.wpe" ".\tileset\ice\bfire.wpe" ".\tileset\ice\bfire.pcx"
AlphaEdit d ".\tileset\ice.wpe" ".\tileset\ice\blue.wpe" ".\tileset\ice\blue.pcx"
AlphaEdit d ".\tileset\ice.wpe" ".\tileset\ice\dark.wpe" ".\tileset\ice\dark.pcx"
AlphaEdit d ".\tileset\ice.wpe" ".\tileset\ice\gfire.wpe" ".\tileset\ice\gfire.pcx"
AlphaEdit d ".\tileset\ice.wpe" ".\tileset\ice\light.wpe" ".\tileset\ice\light.pcx"
AlphaEdit d ".\tileset\ice.wpe" ".\tileset\ice\ofire.wpe" ".\tileset\ice\ofire.pcx"
AlphaEdit d ".\tileset\ice.wpe" ".\tileset\ice\orange.wpe" ".\tileset\ice\orange.pcx"
AlphaEdit d ".\tileset\ice.wpe" ".\tileset\ice\trans50.wpe" ".\tileset\ice\trans50.pcx"
AlphaEdit d ".\tileset\install.wpe" ".\tileset\install\bexpl.wpe" ".\tileset\install\bexpl.pcx"
AlphaEdit d ".\tileset\install.wpe" ".\tileset\install\bfire.wpe" ".\tileset\install\bfire.pcx"
AlphaEdit d ".\tileset\install.wpe" ".\tileset\install\blue.wpe" ".\tileset\install\blue.pcx"
AlphaEdit d ".\tileset\install.wpe" ".\tileset\install\dark.wpe" ".\tileset\install\dark.pcx"
AlphaEdit d ".\tileset\install.wpe" ".\tileset\install\gfire.wpe" ".\tileset\install\gfire.pcx"
AlphaEdit d ".\tileset\install.wpe" ".\tileset\install\light.wpe" ".\tileset\install\light.pcx"
AlphaEdit d ".\tileset\install.wpe" ".\tileset\install\ofire.wpe" ".\tileset\install\ofire.pcx"
AlphaEdit d ".\tileset\install.wpe" ".\tileset\install\orange.wpe" ".\tileset\install\orange.pcx"
AlphaEdit d ".\tileset\install.wpe" ".\tileset\install\trans50.wpe" ".\tileset\install\trans50.pcx"
AlphaEdit d ".\tileset\jungle.wpe" ".\tileset\jungle\bexpl.wpe" ".\tileset\jungle\bexpl.pcx"
AlphaEdit d ".\tileset\jungle.wpe" ".\tileset\jungle\bfire.wpe" ".\tileset\jungle\bfire.pcx"
AlphaEdit d ".\tileset\jungle.wpe" ".\tileset\jungle\blue.wpe" ".\tileset\jungle\blue.pcx"
AlphaEdit d ".\tileset\jungle.wpe" ".\tileset\jungle\dark.wpe" ".\tileset\jungle\dark.pcx"
AlphaEdit d ".\tileset\jungle.wpe" ".\tileset\jungle\gfire.wpe" ".\tileset\jungle\gfire.pcx"
AlphaEdit d ".\tileset\jungle.wpe" ".\tileset\jungle\light.wpe" ".\tileset\jungle\light.pcx"
AlphaEdit d ".\tileset\jungle.wpe" ".\tileset\jungle\ofire.wpe" ".\tileset\jungle\ofire.pcx"
AlphaEdit d ".\tileset\jungle.wpe" ".\tileset\jungle\orange.wpe" ".\tileset\jungle\orange.pcx"
AlphaEdit d ".\tileset\jungle.wpe" ".\tileset\jungle\trans50.wpe" ".\tileset\jungle\trans50.pcx"
AlphaEdit d ".\tileset\platform.wpe" ".\tileset\platform\bexpl.wpe" ".\tileset\platform\bexpl.pcx"
AlphaEdit d ".\tileset\platform.wpe" ".\tileset\platform\bfire.wpe" ".\tileset\platform\bfire.pcx"
AlphaEdit d ".\tileset\platform.wpe" ".\tileset\platform\blue.wpe" ".\tileset\platform\blue.pcx"
AlphaEdit d ".\tileset\platform.wpe" ".\tileset\platform\dark.wpe" ".\tileset\platform\dark.pcx"
AlphaEdit d ".\tileset\platform.wpe" ".\tileset\platform\gfire.wpe" ".\tileset\platform\gfire.pcx"
AlphaEdit d ".\tileset\platform.wpe" ".\tileset\platform\light.wpe" ".\tileset\platform\light.pcx"
AlphaEdit d ".\tileset\platform.wpe" ".\tileset\platform\ofire.wpe" ".\tileset\platform\ofire.pcx"
AlphaEdit d ".\tileset\platform.wpe" ".\tileset\platform\orange.wpe" ".\tileset\platform\orange.pcx"
AlphaEdit d ".\tileset\platform.wpe" ".\tileset\platform\trans50.wpe" ".\tileset\platform\trans50.pcx"
AlphaEdit d ".\tileset\twilight.wpe" ".\tileset\twilight\bexpl.wpe" ".\tileset\twilight\bexpl.pcx"
AlphaEdit d ".\tileset\twilight.wpe" ".\tileset\twilight\bfire.wpe" ".\tileset\twilight\bfire.pcx"
AlphaEdit d ".\tileset\twilight.wpe" ".\tileset\twilight\blue.wpe" ".\tileset\twilight\blue.pcx"
AlphaEdit d ".\tileset\twilight.wpe" ".\tileset\twilight\dark.wpe" ".\tileset\twilight\dark.pcx"
AlphaEdit d ".\tileset\twilight.wpe" ".\tileset\twilight\gfire.wpe" ".\tileset\twilight\gfire.pcx"
AlphaEdit d ".\tileset\twilight.wpe" ".\tileset\twilight\light.wpe" ".\tileset\twilight\light.pcx"
AlphaEdit d ".\tileset\twilight.wpe" ".\tileset\twilight\ofire.wpe" ".\tileset\twilight\ofire.pcx"
AlphaEdit d ".\tileset\twilight.wpe" ".\tileset\twilight\orange.wpe" ".\tileset\twilight\orange.pcx"
AlphaEdit d ".\tileset\twilight.wpe" ".\tileset\twilight\trans50.wpe" ".\tileset\twilight\trans50.pcx"
AlphaEdit m ".\tileset\bexpl.wpe" ".\tileset\ashworld\bexpl.wpe" ".\tileset\badlands\bexpl.wpe" ".\tileset\desert\bexpl.wpe" ".\tileset\ice\bexpl.wpe" ".\tileset\install\bexpl.wpe" ".\tileset\jungle\bexpl.wpe" ".\tileset\platform\bexpl.wpe" ".\tileset\twilight\bexpl.wpe"
AlphaEdit m ".\tileset\bfire.wpe" ".\tileset\ashworld\bfire.wpe" ".\tileset\badlands\bfire.wpe" ".\tileset\desert\bfire.wpe" ".\tileset\ice\bfire.wpe" ".\tileset\install\bfire.wpe" ".\tileset\jungle\bfire.wpe" ".\tileset\platform\bfire.wpe" ".\tileset\twilight\bfire.wpe"
AlphaEdit m ".\tileset\blue.wpe" ".\tileset\ashworld\blue.wpe" ".\tileset\badlands\blue.wpe" ".\tileset\desert\blue.wpe" ".\tileset\ice\blue.wpe" ".\tileset\install\blue.wpe" ".\tileset\jungle\blue.wpe" ".\tileset\platform\blue.wpe" ".\tileset\twilight\blue.wpe"
AlphaEdit m ".\tileset\dark.wpe" ".\tileset\ashworld\dark.wpe" ".\tileset\badlands\dark.wpe" ".\tileset\desert\dark.wpe" ".\tileset\ice\dark.wpe" ".\tileset\install\dark.wpe" ".\tileset\jungle\dark.wpe" ".\tileset\platform\dark.wpe" ".\tileset\twilight\dark.wpe"
AlphaEdit m ".\tileset\gfire.wpe" ".\tileset\ashworld\gfire.wpe" ".\tileset\badlands\gfire.wpe" ".\tileset\desert\gfire.wpe" ".\tileset\ice\gfire.wpe" ".\tileset\install\gfire.wpe" ".\tileset\jungle\gfire.wpe" ".\tileset\platform\gfire.wpe" ".\tileset\twilight\gfire.wpe"
AlphaEdit m ".\tileset\light.wpe" ".\tileset\ashworld\light.wpe" ".\tileset\badlands\light.wpe" ".\tileset\desert\light.wpe" ".\tileset\ice\light.wpe" ".\tileset\install\light.wpe" ".\tileset\jungle\light.wpe" ".\tileset\platform\light.wpe" ".\tileset\twilight\light.wpe"
AlphaEdit m ".\tileset\ofire.wpe" ".\tileset\ashworld\ofire.wpe" ".\tileset\badlands\ofire.wpe" ".\tileset\desert\ofire.wpe" ".\tileset\ice\ofire.wpe" ".\tileset\install\ofire.wpe" ".\tileset\jungle\ofire.wpe" ".\tileset\platform\ofire.wpe" ".\tileset\twilight\ofire.wpe"
AlphaEdit m ".\tileset\orange.wpe" ".\tileset\ashworld\orange.wpe" ".\tileset\badlands\orange.wpe" ".\tileset\desert\orange.wpe" ".\tileset\ice\orange.wpe" ".\tileset\install\orange.wpe" ".\tileset\jungle\orange.wpe" ".\tileset\platform\orange.wpe" ".\tileset\twilight\orange.wpe"
pause
Here's an example of the grp tbangx.grp, which uses the bexpl.pcx alpha blending table. It has been decompressed using SFGrpConv and the bexpl.wpe palette obtained with this utility.
Notice that the border color is glitchy, because it's almost transparent, but for the very same reason it won't be noticeable if the palette is compiled back into a alpha blending table. (Merging the resulting palettes fixed the border color
) Also notice that this picture has no alpha information, i.e., it displays how would the explosion look if it was completely opaque.
Attachments:
Post has been edited 5 time(s), last time on Sep 7 2009, 2:48 pm by Clokr_.
?????