| 11-01-2008, 11:28 AM | #1 | |
This is an attempt to finally and properly document BLP image format used in warcraft 3. For that purpose I extracted headers of all blp images I found in war3.mpq and war3x.mpq Current patch version is v1.22 Zipped text file with this info is attached, here is a sample of what it looks like: JASS:============================================================ Abilities/Spells/Demon/DarkPortal/DemonRune1backup.blp magicMarker = BLP1 compression = 0 flags = 0 width = 128 height = 128 pictureType = 5.1 ============================================================ Abilities/Spells/Human/AerialShackles/ensnare.blp magicMarker = BLP1 compression = 0 flags = 8 width = 64 height = 128 pictureType = 3.1 ============================================================ Abilities/Spells/Human/Banish/GenericGlow2bA.blp magicMarker = BLP1 compression = 0 flags = 8 width = 128 height = 128 pictureType = 4.1 This is what we currently know about BLP:
Here is some statistics I extracted from BLP headers: JASS:All BLPs in warcraft 3 FT are BLP1 (RoC used BLP0, WoW uses BLP2) There is a total of 6266 BLP images in current version of warcraft 3 There are 2 main compression types: compression = 0 - jpeg- used by 4917 images compression = 1 - paletted- used by 1349 images There are 2 flag values: flags = 0 -noalpha- 3874 flags = 8 -alpha- 2392 There are 7 picture types: pictureType = 2.1 - 392 pictureType = 3.0 - 123 pictureType = 3.1 - 245 pictureType = 4.0 - 92 pictureType = 4.1 - 1905 pictureType = 5.0 - 46 pictureType = 5.1 - 3463 Things we do not know: * What do format types 2, 3, 4, 5 mean if you are using jpeg compression? * What do format subtypes .0 and .1 mean? * How is player color coded in images? |
| 11-03-2008, 06:48 PM | #2 |
After directly extracting jpeg images from BLP files I found out that: 1. Red and Blue colors are swapped. 2. Jpeg compression type is so old (2001) it is not supported in java ImageIO 3. Using new jpeg compression inside BLP works but fucksup colors. (even when using BGR instead of RGB) |
| 11-03-2008, 07:08 PM | #3 |
hmnn I am not sure if this should got to resources or tutorials. Or merged with the specs thing we have. |
| 11-03-2008, 07:50 PM | #4 |
I was actually hoping someone would take a more detailed look at this and fill in the missing details. For example I am fairly sure some artists around here know how Player colors are working in skins. |
| 11-04-2008, 12:37 AM | #5 |
That's just the alpha channel, in some geosets, alpha means transparency (or lack of), in other geosets it means [put team color here] Just t saying that is not part of the BLP format. |
| 11-04-2008, 12:57 AM | #6 |
Team Colour is a separate texture on a different material layer, so the alpha on the skin layer is just about the blending mode. None - solid, Transparent - hard edge transparency for alpha'd areas - think the DH's blades Blend - smooth transparency for alpha used for TC mostly but looks bizarre if there's no texture underneath Additive - makes the entire texture semitransparent and drops out the black Additive Alpha - makes the entire texture semitransparent and drops out the alphaed areas and the black. Modulate - inverse of Additive, drops out the white areas, keeping the black. |
| 11-04-2008, 06:11 AM | #7 |
By definition, a compendium of knowledge is a dish best served as a tutorial (Similar to the WC3 ability guide and such). Keep working on this, I'd love to see it finished to your and Vex's liking -- It'd be very useful. Moved, in any case. |
| 11-04-2008, 10:24 AM | #8 |
I'm just curious, but is this legal? 'Cause I thought that BLP was kinda property of Blizzard. |
| 11-04-2008, 10:27 AM | #9 | |
Quote:
This is great. Can you maybe give me specific examples of standard BLPs that use each format? Than I could search them in the list above and see what compression types they are using and fill in the missing details. Is Team-Color monochrome texture? |
| 11-04-2008, 01:24 PM | #10 |
Interesting, I'd try to help with this. - Jpeg is compressed in RGBA colorspace or JCS_UNKNOWN (that's why colors shown swapped). Such jpegs can be handled with jpeg lib by Independent Jpeg Group. - I've heard somewhere, that picture subtype affects only model textures (if 0 - team colors won't show up). Never heard about /2/ picture type, going to test it. |
| 11-04-2008, 02:37 PM | #11 | |
Quote:
|
| 11-06-2008, 10:16 PM | #12 | |
Quote:
Sorry, but it's a bit less elegant than that. The blending mode is information stored in the material of the model, not the texture. Team colour uses a placeholder (Replaceable ID 1, Replaceable ID 2 for glows) which the game then interprets based on information for the in- game unit (which player it appears to be owned by) and substitutes one of the glow or solid team colour textures. There are 16 different team colours and glows (although the last 4 are just black). These are separate textures that can be found in the .mpq under ReplaceableTextures\TeamColor and ReplaceableTextures\TeamGlow. |
| 12-05-2008, 12:48 PM | #13 |
I strongly feel this would be better suited in the Programming forum, so that people looking for this information will actually find it. I'll sticky it there and also link to it from the "Inside the w3m/w3x" thread. |
| 12-05-2008, 08:49 PM | #14 | |
Quote:
At least in Germany Reverse Engineering is allowed - even if EULAs tell different Of course you may not directly use code you got trough this ...but you may reverse engineer programs to look at the code and learn stuff....what is directly what this thread is about ...huh?! |
| 08-20-2009, 06:04 AM | #15 | |
Quote:
At least some of the JPEGs (CorruptedAncientOfWar, BTNArnk) are compatible with the JPEG reader that comes with the JRE. Colours are still fucked, however. The BLPs exported by War3Viewer are not compatible with the default reader, however they are compatible with the Java Advanced Imaging JPEG reader. (https://jai-imageio.dev.java.net/) Again, colours still seem to be fucked. My work continues on an ImageIO reader for BLP1s... (I'll release what I have under zlib if/when i finish it. If I don't finish it, I'll still release it under zlib if anyone cares enough to bother me to.) |
