• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Imperial BLP

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,180
An experimental BLP converter tool written in pure Java. Can load valid BLP0 and 1 files as well as common formats like JPEG and png. It can also save in these formats.

Currently saving in BLP format only supports BLP1 JPEG content 80% quality (Blizzard standard) with alpha precision based on source image and with mipmaps. The resulting BLP files should always work inside WC3.

Requires Java SE 8. If Java 8 is installed it should run a GUI when double clicked, if not you might have to start it from command line.

Simply open a image file and save it in the desired format. It is that simple, if it works...

It is worth noting that this tool is more accurate than BLP Lab when it comes to opening BLP files. It also is more accurate when it comes to saving. However a lot of features are yet to be exposed.
 

Attachments

  • Imperial BLP 0.2.zip
    939.7 KB · Views: 313

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,180
I believe this might be the only tool capable of handling blp0 on the internet right now. Huge thanks
I think the reason for this is that people wrote converters for BLP0 to BLP1. The only difference between the formats, as far as WC3 is concerned, is that BLP0 had separate mipmap files where as BLP1 places all mipmaps in the same file using an offset and size table. Such converter is very easy to write and does not even need to parse the BLP0 header past the file magic identifier (to confirm it is BLP0). In retrospect it might have been better for me to have written such a converter to deal with BLP0 by translating into a temporary BLP1 file as that would have simplified the I/O logic.
 
Level 23
Joined
Jan 1, 2009
Messages
1,608

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,180
Is this the same as this?
Imperial BLP is/was meant to be a wrapper for that API. I never got around to commiting it as the wrapper was in a very primitive state (GUIs are hard...).

I am starting to think a GIMP plugin would probably be a better way to go for a UI as that way GIMP can deal with all the IO and manipulation. Not sure if one can interface JAVA with GIMP though.

As useful as the Java ImageIO plugin system is, its API is kind of messy. Especially how it uses special ImageInput/OutputStreams which are not that compatible with nio and standard io. That said being able to load BLP images in a few lines of code is still useful.
If yes, would you mind a gradle integration PR?
Not too sure how to do that.

Do you also plan mdx ? Oger-Lord had some mdx/blp stuff made before, but he is inactive now.
I currently do not plan to do MDX/MDL. When I do I might start off with one of the existing libraries and clean it up.

Main reason I did BLP was because all other implementations were wrong as they were based off of a wrong BLP specification written during RoC beta and shortly after release. My Java BLP Image IO plugin is the only third party BLP0 and BLP1 to correctly read/write the file format, even if the API is messy and the produced JPEG content BLP files are slightly bloated. For example it can read BLP index colour BLPs with 1 and 4 bit alpha (not used but still supported by WC3), something that at the time no other third party APIs or programs were capable of. Ironically the indexed colour format used by BLP2 (World of Warcraft) works in the same way, just no one thought BLP0/1 supported it.
 
Status
Not open for further replies.
Top