Dr Super Good
Spell Reviewer
- Joined
- Jan 18, 2005
- Messages
- 27,287
So I am working on a Java library containing service providers for the javax.imageio system to read/write (hopefully) ".blp" files. So far I have managed to get image (mipmap) extraction working for BLP1 files with content mode 0 (JPEG container). Although it currently does not load a buffered image of the contents, it does dump the file to disk for viewing. The files dumped appear valid which is good news.
However the JPEG structure produced seems to be unusual and poorly support. It appears to be produced by some imaging library from Intel.
For the high-resolution Gryphon Rider texture this is the dumped JPEG for mipmap level 0 (full size).
What it appears like to you is questionable and probably heavily influenced by display calibration. Poor browser implementations might show you nonsense. The thumbnail is also likely to appear garbage as I doubt the quality of the imaging libraries used by the server. However what it should be is the correct texture including alpha with exception of the red and blue colour channels being swapped (part of the blp specification). Alpha should also be producing some visual indicator that may or may not be correct (depends on blp specification of the meaning of alpha).
For comparison this is what GIMP sees it as after the colours are swapped. This image should not be subject to display calibration as GIMP appeared to use the intended profile to interpret the image. Notice that the alpha data appears to have been lost (it was loaded as a RGB image only).
This is how it looks if a RGB dump is made with BLPLab tool which should be interpreting the file correctly. Again the colour channels have been swapped for you. Obviously alpha is lost but the detail contained in the alpha is not (unlike the GIMP processed image).
The unprocessed JPEG dump is interpreted completely incorrectly by Paint Shop Pro. By the looks of the produced image it is not converting colour space correctly into RGB. This is likely the result of missing support or non-compliance with the JPEG standard. Hence why I used GIMP since it appears to be more compliant.
The big question is what is going on with the alpha channel. The dumped unprocessed image is a "JPEG File Interchange Format (JFIF)" compliant image. Decent implementations of JPEG such as used by GIMP do load the RGB colours correctly from it however the alpha information is lost.
I am still investigating the exact standards used by the dumped JPEG file, specifically how the alpha is stored. So far I suspect it uses a slightly different colour space from usual with it being either YCBCR or Y′CBCR (which ever of the two is not used by most JPEG files). The image is also generated by Intel imaging libraries according to meta data. It must also be using parts of the standard defined before 2004 for logical reasons.
The documentation of what JPEG format blp supports is very poor. If it was fully understood it may be possible to generate smaller blp files (useful for mappers) or higher quality blp files (lossless) than previously possible.
In any case feel free to mess around with the dumped image and see if you can make anything of it.
However the JPEG structure produced seems to be unusual and poorly support. It appears to be produced by some imaging library from Intel.
For the high-resolution Gryphon Rider texture this is the dumped JPEG for mipmap level 0 (full size).
What it appears like to you is questionable and probably heavily influenced by display calibration. Poor browser implementations might show you nonsense. The thumbnail is also likely to appear garbage as I doubt the quality of the imaging libraries used by the server. However what it should be is the correct texture including alpha with exception of the red and blue colour channels being swapped (part of the blp specification). Alpha should also be producing some visual indicator that may or may not be correct (depends on blp specification of the meaning of alpha).
For comparison this is what GIMP sees it as after the colours are swapped. This image should not be subject to display calibration as GIMP appeared to use the intended profile to interpret the image. Notice that the alpha data appears to have been lost (it was loaded as a RGB image only).
This is how it looks if a RGB dump is made with BLPLab tool which should be interpreting the file correctly. Again the colour channels have been swapped for you. Obviously alpha is lost but the detail contained in the alpha is not (unlike the GIMP processed image).
The unprocessed JPEG dump is interpreted completely incorrectly by Paint Shop Pro. By the looks of the produced image it is not converting colour space correctly into RGB. This is likely the result of missing support or non-compliance with the JPEG standard. Hence why I used GIMP since it appears to be more compliant.
The big question is what is going on with the alpha channel. The dumped unprocessed image is a "JPEG File Interchange Format (JFIF)" compliant image. Decent implementations of JPEG such as used by GIMP do load the RGB colours correctly from it however the alpha information is lost.
I am still investigating the exact standards used by the dumped JPEG file, specifically how the alpha is stored. So far I suspect it uses a slightly different colour space from usual with it being either YCBCR or Y′CBCR (which ever of the two is not used by most JPEG files). The image is also generated by Intel imaging libraries according to meta data. It must also be using parts of the standard defined before 2004 for logical reasons.
The documentation of what JPEG format blp supports is very poor. If it was fully understood it may be possible to generate smaller blp files (useful for mappers) or higher quality blp files (lossless) than previously possible.
In any case feel free to mess around with the dumped image and see if you can make anything of it.