diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2025-02-04 20:24:36 +0100 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2025-02-04 20:24:36 +0100 |
| commit | 513021a7b0ea1d148fcc333c09ae06b139611dee (patch) | |
| tree | f5be1c27a1beb37c2f859496446913521588b15f | |
| parent | 93c8c2f27f0899ea412147d0e18554273442d19c (diff) | |
| download | blpconvert-513021a7b0ea1d148fcc333c09ae06b139611dee.tar.gz | |
Added readme and license
| -rw-r--r-- | LICENSE | 24 | ||||
| -rw-r--r-- | Makefile | 4 | ||||
| -rw-r--r-- | README.md | 71 | ||||
| -rw-r--r-- | main.c (renamed from blpconvert.c) | 0 |
4 files changed, 97 insertions, 2 deletions
@@ -0,0 +1,24 @@ +BSD 2-Clause License + +Copyright (c) 2025, Mitja Felicijan <mitja.felicijan@gmail.com> + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @@ -1,2 +1,2 @@ -blpconvert: blpconvert.c - clang -o blpconvert blpconvert.c +blpconvert: main.c + cc -o blpconvert main.c @@ -0,0 +1,71 @@ +# Converts BLP to PNG + +This tool converts images in BLP texture file format used in many games such as +World of Warcraft into PNG files. + +It works with DXT1, DXT3 and DXT5 compressions so it should convert anything +from WoW. + +It should work on all operating systems. There is no funky code in this +repository or or any dependencies you need to have installed on your machine. C +compiler and Libc is all you need. + +## Compile & Use + +```sh +make -B +``` + +This will create `blpconvert` binary. Check available options with +`./blpconvert -h`. + +Basic example of usage is `./blpconvert samples/Ability_Ambush.blp`. + +You can provide multiple input files or you can also use Bash expansion when +providing files to the tool. + +```sh +./blpconvert samples/*.blp +``` + +## Verbose output + +If you provide `-v` flag the program will output a bunch of diagnostical data. + +```sh +$ ./blpconvert samples/Ability_Ambush.blp -v +Processing File: + Fullname: samples/Ability_Ambush.blp + Folder: samples + Filename: Ability_Ambush + Extension: .blp +BLP File Details: + Type: 1, BLP/DXTC/Uncompressed + Compression: 2, DXTC + Alpha Depth: 8 + Alpha Type: 1 + Has Mipmaps: 17 + Width: 64, Height: 64 +Reading image data at offset 1172, size 4096 bytes +BLP is compressed with DXTC. +Image has 4096 bytes. +Saving decoded image as PNG... +Successfully saved samples/Ability_Ambush.png + +First few pixels of decoded image (RGBA format): +( 0, 0, 0, 0) ( 0, 0, 0, 0) ( 0, 0, 0, 0) ( 0, 0, 0, 0) +( 0, 0, 0, 0) ( 0, 0, 0, 0) ( 0, 0, 0, 0) ( 0, 0, 0, 0) +( 0, 0, 0, 0) ( 0, 0, 0, 0) ( 0, 0, 0, 51) (184,200,200,221) +( 0, 0, 0, 0) ( 0, 0, 0, 0) (184,200,200,221) (184,200,200,255) +``` + +## Reading material + +- https://wowwiki-archive.fandom.com/wiki/BLP_file +- https://en.wikipedia.org/wiki/S3_Texture_Compression + +## License + +[blpconvert](https://github.com/mitjafelicijan/blpconvert) was written by [Mitja +Felicijan](https://mitjafelicijan.com) and is released under the BSD +two-clause license, see the LICENSE file for more information. |
