Compare commits

...

No commits in common. 'master' and 'wiki' have entirely different histories.
master ... wiki

@ -1,3 +0,0 @@
# These are supported funding model platforms
github: castano

@ -1,33 +0,0 @@
name: build
on: [push, pull_request]
jobs:
vs2017:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- uses: microsoft/setup-msbuild@v1.0.0
- name: Build Debug/x64
run: msbuild .\project\vc2017\nvtt.sln /property:Configuration=Debug /property:Platform=x64
- name: Build Debug/Win32
run: msbuild .\project\vc2017\nvtt.sln /property:Configuration=Debug /property:Platform=Win32
- name: Build Release/x64
run: msbuild .\project\vc2017\nvtt.sln /property:Configuration=Release /property:Platform=x64
- name: Build Release/Win32
run: msbuild .\project\vc2017\nvtt.sln /property:Configuration=Release /property:Platform=Win32
unix:
strategy:
matrix:
os: [ubuntu, macos]
name: ${{matrix.os}}
runs-on: ${{matrix.os}}-latest
steps:
- uses: actions/checkout@v2
- name: make
run: |
./configure --debug
make
./configure --release
make

17
.gitignore vendored

@ -1,17 +0,0 @@
**/bin/
**/obj/
**/Debug/
**/Release/
**/Debug.x64/
**/Release.x64/
**/Debug.Win32/
**/Release.Win32/
**/Debug-CUDA/
**/Release-CUDA/
*.vcxproj.user
*.opensdf
*.sdf
*.suo
build
.vs
project/nvtt.sublime-workspace

@ -0,0 +1,70 @@
## General Issues ##
* does nvtt have state? should we have a context? Don't use globals/statics.
## InputOptions ##
* ~~Default mipmap filter should be Box instead of Kaiser.~~ (Fixed)
* Remove `Format_LATC`, stop adding more aliases.
### Alpha transparency ###
* `alphaTransparency` should not be specified in setFormat.
* Add `setAlphaMode(AlphaMode mode)`
Where `AlphaMode` could be:
* AlphaMode\_None
* AlphaMode\_Transparency
* AlphaMode\_Premultiplied
None is the default (treats alpha as a regular channel) while Transparency and Premultiplied are hints. Currently there are some compressors that only support None, others that only support Transparency.
### Mipmapping options ###
~~Option 1:~~
* Deprecate setMipmapping.
* Add `setMipmapFilter(MipmapFilter filter)`
* ~~Add maxLevel argument to `setTextureLayout`~~
* To disable mipmap output set maxLevel = 0.
Option 2:
* Deprecate setMipmapping.
* Add `setMipmapFilter(MipmapFilter filter)`
* Add `enableMipmaps(bool enable)`
* Add `setMipmapMaxLevel(int maxLevel)`
Option 3:
* Add `setMipmapFilter(MipmapFilter filter)`
* Remove filter argument from `setMipmapping`: `setMipmapping(bool enabled, int maxLevel)`
Option 4:
* Leave things as is.
## CompressionOptions ##
* `enableHardwareCompressor`, should be called `enableCudaCompressor` or `enableGpuCompressor`.
* `Quantization` should be a compression option.
* remove error threshold from setQuality, it's not used.
* `setColorWeights` should take an alpha weight, not used right now, but useful for future formats.
## OutputOptions ##
* Should be a pimpl like `InputOptions` and `CompressionOptions`. Member attributes should be hidden.
* Add `setFileName()` member to output dds file directly instead of using output handler.
### Output Handling ###
* `OutputHandler::writeData` should return false to signal a write error and stop processing.
* The `mipmap` method of `OutputHandler` should have been called `image` or `beginImage`.
### Error Handling ###
* Error\_Unknown should be 0
* Error\_UserInterruption is not being used and could be removed.

@ -0,0 +1,613 @@
## Contents ##
* [Introduction](ApiDocumentation#Introduction.md)
* [Usage](ApiDocumentation#Usage.md)
* [Input Options](ApiDocumentation#Input_Options.md)
* [Specifying Input Images](ApiDocumentation#Specifying_Input_Images.md)
* [Mipmap Generation](ApiDocumentation#Mipmap_Generation.md)
* [Alpha Mode](ApiDocumentation#Alpha_Mode.md)
* [Gamma Correction](ApiDocumentation#Gamma_Correction.md)
* [Processing Normal Maps](ApiDocumentation#Processing_Normal_Maps.md)
* [Generating Normal Maps](ApiDocumentation#Generating_Normal_Maps.md)
* [Image Resizing](ApiDocumentation#Image_Resizing.md)
* [Color Transforms](ApiDocumentation#Color_Transforms.md)
* [Compression Options](ApiDocumentation#Compression_Options.md)
* [Compression Formats](ApiDocumentation#Compression_Formats.md)
* [Compression Quality](ApiDocumentation#Compression_Quality.md)
* [GPU Acceleration](ApiDocumentation#GPU_Acceleration.md)
* [Color Weighting](ApiDocumentation#Color_Weighting.md)
* [Pixel Format Conversion](ApiDocumentation#Pixel_Format_Conversion.md)
* [Quantization](ApiDocumentation#Quantization.md)
* [Output Options](ApiDocumentation#Output_Options.md)
* [Output Handler](ApiDocumentation#Output_Handler.md)
* [Producing DDS Files](ApiDocumentation#Producing_DDS_Files.md)
* [Reporting Progress](ApiDocumentation#Reporting_Progress.md)
* [Handling Errors](ApiDocumentation#Handling_Errors.md)
## Introduction ##
The NVIDIA Texture Tools library (NVTT for short) is a C++ library that allows you to create textures compressed in any of the DX10 texture formats, and apply certain transformations to them such as mipmap generation, and normal map conversion.
There are also bindings for other languages, see [LanguageBindings](LanguageBindings.md).
## Usage ##
By default NVTT is compiled as a shared library. To use it in your application you only have to link it implicitly. With gcc that's achieved using `-lnvtt`, and with Visual Studio you have to add `nvtt.lib` to the Linker -> Input -> Additional Dependencies field of the project settings. For compilation instructions see [CompilationInstructions](CompilationInstructions.md).
In order to access the API you only have to include the [nvtt.h](http://code.google.com/p/nvidia-texture-tools/source/browse/trunk/src/nvtt/nvtt.h) header file:
```
#include <nvtt/nvtt.h>
```
All the members of the API are in the `nvtt` namespace. Members outside of the `nvtt` namespace should not be considered public and are subject to change. If you want your code to always stay compatible with the latest release of NVTT, you should not include other headers, nor use members outside of the `nvtt` namespace.
As new features are added to NVTT, binary compatibility will always be preserved. That should allow upgrading to new versions without even having to recompile the application code.
The most important function of the NVTT API is the following:
```
bool Compressor::process(const InputOptions &, const CompressionOptions &, const OutputOptions &);
```
It takes the texture defined by `InputOptions`, compresses it according to the `CompressionOptions` and outputs it according to the `OutputOptions`. These classes are documented in detail in the following sections.
Here's a very simple usage example:
```
InputOptions inputOptions;
inputOptions.setTextureLayout(TextureType_2D, w, h);
inputOptions.setMipmapData(data, w, h);
OutputOptions outputOptions;
outputOptions.setFileName("output.dds");
CompressionOptions compressionOptions;
compressionOptions.setFormat(Format_DXT1);
Compressor compressor;
compressor.process(inputOptions, compressionOptions, outputOptions);
```
## Input Options ##
The `InputOptions` class describes the images that compose the compressed texture, and several image processing operations that can be applied to them.
### Specifying Input Images ###
Before specifying the image data, the layout of the texture has to be defined. This is done with the following method:
```
void InputOptions::setTextureLayout(TextureType type, int width, int height, int depth=1);
```
where texture `type` is one of the following:
* TextureType\_2D
* TextureType\_Cube
Note that 3D textures are not supported yet. The `depth` argument should always be equal to 1.
Once the layout of the texture has been defined, the data for each of the images can be provided with the following method:
```
bool InputOptions::setMipmapData(const void * data, int w, int h, int d, int face, int mipmap);
```
NVTT internally allocates a copy of the provided data, that allows you to delete or reuse the memory.
If the width, height or depth of the provided mipmap does not match the one expected by the layout, then the function returns false, otherwise it returns true.
Again, since 3D textures are not supported, the depth argument should always be set to 1.
**TODO**: explain how the size of the mipmaps is computed, specially for non powers of two.
### Mipmap Generation ###
Each of the faces of the surface is composed of a mipmap chain. You can provide each of these images explicitely with the `setMipmapData` method, but you can also disable mipmap generation or let the library compute the mipmaps procedurally. The following method provides some control over this process:
```
void InputOptions::setMipmapGeneration(bool enabled, int maxLevel);
```
In order to output mipmaps for each of the faces of the surface, the `enabled` argument should be set to true.
If the mipmap image is not provided explicitly by the application, and generate mipmaps is enabled, then the mipmaps will be generated automatically from the previous level using a downsampling filter. It's also possible to provide incomplete mipmap chains, and the missing levels will be generated using the same process.
By default the entire mipmap chain is generated, but it's possible to limit the number of mimap levels generated with the `maxLevel` argument. When `maxLevel` is set to -1, this argument has no effect.
It's possible to specify the mipmap generation filter using the following method:
```
void InputOptions::setMipmapFilter(MipmapFilter filter);
```
Where `filter` is one of the following options:
* MipmapFilter\_Box
* MipmapFilter\_Triangle
* MipmapFilter\_Kaiser
`MipmapFilter_Box` is a [polyphase box filter](http://developer.nvidia.com/object/np2_mipmapping.html). It's the default option and good choice for most cases. It's also much faster than the other filters.
`MipmapFilter_Triangle` uses a triangle filter. The kernel has a larger width and thus produces blurrier results than the box filter.
`MipmapFilter_Kaiser` is a Kaiser-windowed sinc filter. That's generally considered the best choice for downsampling filters, but in order to obtain best results it may be required to tweak some of the parameters of the filter, otherwise the resulting images could suffer from ringing artifacts or the result may not be as sharp as desired. The default values of the parameters are generally safe, but it's possible to tweak them using the following method:
```
void InputOptions::setKaiserParameters(float width, float alpha, float stretch);
```
The default values are:
```
inputOptions.setKaiserParameters(3.0f, 4.0f, 1.0f);
```
Larger kernel widths are supposed to approximate better a perfect low pass filter, but sometimes result in ringing artifacts. Values above 5 are not recommended. You should not change the alpha and stretch values unless you know what you are doing.
You can compare the result of each of these filters at [ResizeFilters](ResizeFilters.md). For more information about mipmap generation algorithms see [MipmapGeneration](MipmapGeneration.md).
When evaluating the color of texels that are near the border, most the filters usually sample outside of the texture. By default, NVTT assumes the texture wrapping mode is to mirror, because that generally looks good, but better results can be achieved by explicitly specifying the desired wrapping mode. That can be done with the following method:
```
void InputOptions::setWrapMode(WrapMode wrapMode);
```
Where the `wrapMode` argument must have one the following values:
* WrapMode\_Mirror
* WrapMode\_Repeat
* WrapMode\_Clamp
Note that the `wrapMode` is also used for other image processing operations, like normal map generation. So, it's a good idea to set it even if you are not generating mipmaps. The default `wrapMode` is `WrapMode_Mirror`.
### Alpha Mode ###
The contents of the alpha channel influences the mipmap generation and compression of the images. If the alpha channel contains transparency information that can be taken into account to produce more accurate results.
In order to achieve that, the alpha mode can be specified with the following method:
```
void InputOptions::setAlphaMode(AlphaMode alphaMode);
```
Where the `alphaMode` argument has one of the following values:
* AlphaMode\_None
* AlphaMode\_Transparency
* AlphaMode\_Premultiplied
When the `alphaMode` is `AlphaMode_None` the alpha and color channels are processed independently. However, if the alpha is used for transparency it should be set to `AlphaMode_Transparency`, except when the alpha is premultiplied, in which case `AlphaMode_Premultiplied` should be used. The default `alphaMode` is `AlphaMode_None`.
### Gamma Correction ###
For a good discussion about why gamma correction is important and why you should filter your images in linear space, read <a href='http://number-none.com/product/Mipmapping,%20Part%202/index.html'>Jon Blow's Mipmapping article at the Inner Product</a>.
In order to process images that are not in linear space, and output images in the desired gamma space, NVTT allows you to specify the input and output gamma values with the following method:
```
void InputOptions::setGamma(float inputGamma, float outputGamma);
```
By default, both the `inputGamma` and the `outputGamma` are set to 2.2. Gamma correction is only applied to the RGB channels. It's not applied to the alpha channel and it's never applied to normal maps. You can disable gamma correction by setting these values to 1.0 as follows:
```
inputOptions.setGamma(1.0f, 1.0f);
```
### Processing Normal Maps ###
If the input image is a normal map, it may require some special treatment. For example, gamma correction won't be applied, and some operations will only be active for normal maps. To indicate that the input image is a normal map the following method is used:
```
void InputOptions::setNormalMap(bool isNormalMap);
```
Normal map mipmaps are generated by down filtering the previous normal map level, just like with regular images. However, after down filtering the resulting normals are generally not unit length. By default, these normals are re-normalized, but you can chose to left them unnormalized with the following method:
```
void InputOptions::setNormalizeMipmaps(bool normalizeMipmaps);
```
### Generating Normal Maps ###
**TODO**: Explain how normal maps are generated from color images or height maps.
```
inputOptions.convertToNormalMap(true);
```
```
bool InputOptions::setHeightEvaluation(float r, float g, float b, float a);
```
For example, to use the alpha channel of the input texture as the height you would use the following weights:
```
inputOptions.setHeightEvaluation(0, 0, 0, 1);
```
The height factors do not necessarily sum 1. So, you can also use them to change the steepness of the height map, and the sharpness of the resulting normal map.
**TODO**: Explain normal filter, add wiki page that compares different values.
```
void InputOptions::setNormalFilter(float small, float medium, float big, float large);
```
Mipmap generation behaves as with regular normal maps. The input images are first converted to normal map. Then the mipmaps are generated from the normal maps as usual, unless the user provides the mipmaps explicitly, in which case normal map conversion is applied again.
**TODO**: Normal map conversion is only done to the input images. Mipmaps are generated from the normal map as usual.
### Image Resizing ###
It's possible to constrain the size of the textures to a certain limit. This is accomplished with the following method:
```
void InputOptions::setMaxExtents(int d);
```
NVTT is able to handle non power of two textures correctly, but not all hardware supports them. It's possible to round the size of the input images to the next, nearest, or previous power of two. The desired rounding mode is specified with the following method.
```
void InputOptions::setRoundMode(RoundMode mode);
```
where `RoundMode` is one of the following:
* RoundMode\_None
* RoundMode\_ToNextPowerOfTwo
* RoundMode\_ToNearestPowerOfTwo
* RoundMode\_ToPreviousPowerOfTwo
The default round mode is none.
### Color Transforms ###
The colors of the input image can also be transformed to a different color space. This transform is specified with the following method:
```
void InputOptions::setColorTransform(ColorTransform t);
```
Where `ColorTransform` is one of the following:
```
enum ColorTransform
{
ColorTransform_None,
ColorTransform_Linear,
ColorTransform_Swizzle,
};
```
Currently only one transform can be specified at a time. By default no transformation is performed, which is equivalent to `ColorTransform_None`.
Linear color transforms are performed in linear space and before mipmap generation. The transformation of every channel is specified with the following function:
```
void InputOptions::setLinearTransform(int channel, float w0, float w1, float w2, float w3, float offset);
```
For example, to transform the input image to YCbCr color space:
```
Y = + 0.299 * R + 0.587 * G + 0.114 * B
Cb = 128 - 0.168736 * R - 0.331264 * G + 0.5 * B
Cr = 128 + 0.5 * R - 0.418688 * G - 0.081312 * B
```
You would use the following code:
```
inputOptions.setLinearTransform(0, 0.299, 0.587f, 0.114f, 0);
inputOptions.setLinearTransform(1, -0.168736, -0.331264, 0.5, 0, 128);
inputOptions.setLinearTransform(2, 0.5, -0.418688, -0.081312, 0, 128);
inputOptions.setLinearTransform(3, 0, 0, 0, 1);
```
If you simply want to swizzle the channels, you can also achieve that with `setLinearTransform`, but it's much more convenient to use the following function:
```
void InputOptions::setSwizzleTransform(int x, int y, int z, int w);
```
Where the indices represent the following channels or values:
| **index** | **channel/value** |
|:----------|:------------------|
| 0 | R |
| 1 | G |
| 2 | B |
| 3 | A |
| 4 | 1.0 |
| 5 | 0.0 |
| 6 | -1.0 |
## Compression Options ##
**TODO**
### Compression Formats ###
NVTT supports all the Direct3D10 block compression formats and some variations that use these formats to represent normals or to represent colors with higher quality. The compression format is specified as follows:
```
compressionOptions.setFormat(format);
```
The supported block compression formats are the following:
* Format\_BC1 (DXT1)
> This is the default block compression format. By default, the implicit 1 bit alpha channel is not used and is always opaque.
* Format\_BC1a (DXT1a)
> This is a variation of BC1 that supports a 1 bit alpha channel.
* Format\_BC2 (DXT3)
> This is a block compression format similar to BC1, but with an explicit 3 bit alpha channel.
* Format\_BC3 (DXT5)
> This is a block compression format similar to BC1, but with a compressed alpha block.
* Format\_BC3n (DXT5nm)
> This is a variation of BC3 that is used to represent normal maps by encoding the X and Y components as follows: R=1, G=Y, B=0, A=X, this swizzle is used to facilitate decompression using [Capcon's DXT decompression trick](http://code.google.com/p/nvidia-texture-tools/wiki/NormalMapCompression#Capcon%27s_DXT_trick)
* Format\_BC4 (ATI1)
> This is a block compression format that only contains a single alpha block.
* Format\_BC5 (LATC, RGTC, 3Dc, ATI2)
> This is a block compression format that contains two alpha blocks. It's typically used to compress normal maps.
The following formats are only available in NVTT 2.0:
* Format\_DXT1n
> Not yet supported.
* Format\_CTX1
> Not yet supported.
* Format\_YCoCg\_DXT5
> Not yet supported.
### Compression Quality ###
It's possible to control the quality of the compressor using the following method:
```
compressionOptions.setQuality(quality);
```
Where `quality` is one of the following:
* Quality\_Fastest
* Quality\_Normal
* Quality\_Production
* Quality\_Highest
`Quality_Fastest` will select a quick compressor that produces reasonable results in a very short amount of time. Note that this is not a real-time compressor. The code is not highly optimized, but still it's generally one order of magnitude faster than the normal CPU compression mode. If you need real-time compression you can find more resources at: [RealTimeDXTCompression](RealTimeDXTCompression.md).
`Quality_Normal` is the default mode and the one you should use in most cases. It provides a good trade off between compression quality and speed.
`Quality_Production` will generally produce similar results as `Quality_Normal`, but it may double or triple the compression time to obtain minor quality improvements.
`Quality_Highest` is a brute force compressor. In some cases, depending on the size of the search space, this compressor will be extremely slow. Use this only for testing purposes, to determine how much room is left for improvement in the regular compressors.
The following table indicates what compressor types are available for each of the compression formats.
| | **Fastest** | **Normal** | **Production** | **Highest** |
|:-----|:------------|:-----------|:---------------|:------------|
| BC1 | Yes | Yes | | |
| BC1a | Yes | | | |
| BC2 | Yes | Yes | | |
| BC3 | Yes | Yes | | |
| BC3n | Yes | Yes | | |
| BC4 | Yes | Yes | Yes | |
| BC5 | Yes | Yes | Yes | |
Selecting a compression quality that's not available won't produce any error, but instead it will fall back to another compression mode. If `Quality_Production` is not available, `Quality_Normal` will be used instead, and if `Quality_Normal` is not available, `Quality_Fastest` will be used. `Quality_Highest` will never be used as a fallback.
### GPU Acceleration ###
Not all the compressors are GPU accelerated. Some formats can be compressed relatively fast, but others are much more expensive. Currently GPU acceleration is implemented only for the slowest compression modes, as shown in the following table:
| | **GPU Accelerated** |
|:-----|:--------------------|
| BC1 | Yes |
| BC1a | |
| BC2 | Color only |
| BC3 | Color only |
| BC3n | |
| BC4 | |
| BC5 | |
High quality texture compression is a complex problem that would be very hard to solve using traditional GPGPU approaches (that is, using the graphics API, vertex, and fragment shaders). For this reason GPU compression is implemented in CUDA. Note that currently, CUDA is only available on NVIDIA GeForce 8 series.
When available, CUDA compression is enabled by default, but can be disabled as follows:
```
compressor.enableCudaAcceleration(false);
```
The GPU compressors do not provide exactly the same result as the CPU compressors. However, the difference between the two compressors is always very small and not noticeable to the eye.
### Color Weighting ###
By default, the compression error is measured for each channel uniformly. However, for some images it makes more sense to measure the error in a perceptual color space. This can be achieved with the following function:
```
compressionOptions.setColorWeights(float red, float green, float blue, float alpha=1.0f);
```
The choice for the weights of each color channel is subjective. In many cases uniform color weights (1.0, 1.0, 1.0) work very well. A popular choice is to use the NTSC luma encoding weights (0.2126, 0.7152, 0.0722), but I think that blue contributes to our perception more than a 7%. A better choice in my opinion is (3, 4, 2).
### Pixel Format Conversion ###
In addition to the block compression formats, NVTT can also convert the input image to an arbitrary pixel format. That's achieved selecting the `Format_RGBA` output format as follows:
```
compressionOptions.setFormat(Format_RGBA);
```
The output pixel format can be described with one of these two functions:
```
void CompressionOptions::setPixelFormat(uint bitcount, uint rmask, uint gmask, uint bmask, uint amask);
void CompressionOptions::setPixelFormat(unsigned char rsize, unsigned char gsize, unsigned char bsize, unsigned char asize);
```
The first one is more flexible, but it's limited to 32 bits per color. The color masks allow you to indicate the position and size of each of the color components.
For example, to select the RGB 5:6:5 output format you would use the following code:
```
compressionOptions.setPixelFormat(16, 0x001F, 0x07E0, 0xF800, 0);
```
The second function is only available in NVTT 2.0. It assumes that the colors are in RGBA order and that there are no padding bits between color components. However, colors don't have any size limitation. This function is specially useful to output floating point color formats, whose size is generally greater than 32 bits.
To indicate that the desired output is in floating point, you should use the following function:
```
void CompressionOptions:: setPixelType(PixelType pixelType);
```
Here are some usage examples to produce some of the DX10 floating point formats:
```
// DXGI_FORMAT_R16G16_FLOAT
compressionOptions.setPixelType(PixelType_Float);
compressionOptions.setPixelFormat(16, 16, 0, 0);
// DXGI_FORMAT_R32G32B32A32_FLOAT
compressionOptions.setPixelType(PixelType_Float);
compressionOptions.setPixelFormat(32, 32, 32, 32);
```
By default pixel rows of unaligned pixel formats are aligned to the next byte boundary. However, it's possible to change that behavior using the following function:
```
void CompressionOptions:: setPitchAlignment(int pitchAlignment);
```
Where `pitchAlignment` must be a positive number and a power of two, and is given in bytes. By default the pitch alignment is set to 1. Note, that previous versions of NVTT incorrectly aligned the pitch to 4 bytes by default. So, to obtain the same behavior you now have to explicitly set the alignment as follows:
```
compressionOptions.setPitchAlignment(4);
```
### Quantization ###
The compressor can dither the colors to the output bitcount before compression or during quantization. When using DXT compression this does not generally improve the quality of the output image, but in some cases it can produce smoother results. It's generally a good idea to enable dithering when the output format is `Format_RGBA`.
Color and alpha dither can be enabled independently with the following option:
```
void CompressionOptions::setQuantization(bool colorDithering, bool alphaDithering, bool binaryAlpha, int alphaThreshold = 127);
```
**TODO** Explain binary alpha, alpha threshold.
## Output Options ##
The most simple way of configuring the output options is by only providing the name of the file that will contain the resulting DDS texture:
```
OutputOptions::setFileName(const char *);
```
```
OutputOptions::setOutputHandler(OutputHandler *);
```
### Output Handler ###
The output handler is an interface that defines these three methods:
```
virtual void beginImage(int size, int width, int height, int depth, int face, int miplevel) = 0;
virtual bool writeData(const void * data, int size) = 0;
virtual void endImage() = 0; // NVTT 2.1
```
Applications need to implement this interface in order to receive compressed textures from the compressor. The `writeData` method is first called with the contents of the texture header, and after that, the compressor calls `beginImage` and `endImage` to delimitate the data that corresponds to each image of the texture. You can use these two methods for example to allocate and deallocate temporary memory to hold the data
received through the `writeData` method.
Note that some compressors output one compressed block at a time, while others output one image at a time, so your implementation of the `OutputHanlder` needs to be designed to handle multiple consecutive calls to `writeData` for each compressed image.
### Producing Texture Files ###
By default the compressor calls the `writeData` method with the contents of a texture header. If you don't want to output the texture to a file, you can ignore these calls, or disable them with:
```
outputOptions.setOutputHeader(false);
```
If however, you want to generate a texture file, you can choose what container format as follows:
```
outputOptions.setContainer(container);
```
where container is one of:
* `Container_DDS`
* `Container_DDS10`
In the future it may be interesting to add support for other formats such as [VTF](http://developer.valvesoftware.com/wiki/Valve_Texture_Format) or [KTX](http://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/).
### Reporting Progress ###
**TODO**
### Handling Errors ###
NVTT will produce errors in some circumstances. In order to detect them it's possible to register an error handler with the following method:
```
OutputOptions::setErrorHandler(ErrorHandler *);
```
The `ErrorHandler` interface has a single method:
```
virtual void error(Error e) = 0;
```
That receives one of these error codes:
* Error\_Unknown
* Error\_InvalidInput
* Error\_UnsupportedFeature
* Error\_CudaError
* Error\_FileOpen
* Error\_FileWrite
It's possible to translate the error codes to strings using the following function:
```
const char * nvtt::errorString(Error e);
```

@ -1,63 +0,0 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0)
PROJECT(NV)
ENABLE_TESTING()
SET(NV_CMAKE_DIR "${NV_SOURCE_DIR}/cmake")
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${NV_CMAKE_DIR}")
# Compiler check (needs -std:c++11 flag)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
else()
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
INCLUDE(${NV_CMAKE_DIR}/OptimalOptions.cmake)
IF(CMAKE_BUILD_TYPE MATCHES "debug")
SET(CMAKE_DEBUG_POSTFIX "_d" CACHE STRING "Postfix for debug build libraries.")
ADD_DEFINITIONS(-D_DEBUG=1)
ENDIF()
ADD_SUBDIRECTORY(extern)
ADD_SUBDIRECTORY(src)
# These files should only be installed when creating packages.
INSTALL(FILES
LICENSE
README.md
DESTINATION share/doc/nvtt)
# Add packaging support
INCLUDE(InstallRequiredSystemLibraries)
IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
SET(CPACK_GENERATOR "TGZ;DEB")
ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
SET(CPACK_PACKAGE_NAME "nvidia-texture-tools")
SET(CPACK_PACKAGE_VERSION_MAJOR "2")
SET(CPACK_PACKAGE_VERSION_MINOR "1")
SET(CPACK_PACKAGE_VERSION_PATCH "2")
SET(CPACK_PACKAGE_VERSION "2.1.2")
SET(CPACK_PACKAGE_CONTACT "Ignacio Castaño <castano@gmail.com>")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Texture processing tools with support for Direct3D 10 and 11 formats.")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${NV_SOURCE_DIR}/README.md")
SET(CPACK_RESOURCE_FILE_LICENSE "${NV_SOURCE_DIR}/LICENSE")
# NSIS options:
IF(WIN32)
SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_VENDOR}\\\\NVIDIA Texture Tools 2.1")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}\\\\NVIDIA Texture Tools 2.1")
SET(CPACK_PACKAGE_ICON "${NV_SOURCE_DIR}\\\\project\\\\vc2017\\\\nvcompress\\\\nvidia.ico")
ENDIF(WIN32)
INCLUDE(CPack)

@ -1,122 +0,0 @@
NVIDIA Texture Tools version 2.1.2
* Use ICBC as the main BC1 compressor.
* Various fixes.
NVIDIA Texture Tools version 2.1.1
* Various fixes.
NVIDIA Texture Tools version 2.1.0
* Too many changes to list here.
* CTX1 CUDA compressor.
* DXT1n CUDA compressor.
* Support alpha premultiplication by Charles Nicholson. See issue 30.
* Improved decompressor tool submitted by Amorilia. See issue 41.
* Add support for YCoCg color transform. Fixes issue 18.
* Add support for linear and swizzle transforms. Fixes issue 4.
* Fix loading of EXR files using OpenEXR.
* Use FreeImage as primary image loading library. Fixes issue 31. Reverted.
* Output swizzle codes like AMD's tools.
* Added support for saving PNGs by Frank Richter. Fixes issue 79 and 80.
* Added gnome thumbnailer by Frank Richter. Fixes issue 82.
* Cleanup sources removing files that are not strictly required.
NVIDIA Texture Tools version 2.0.7
* Output correct exit codes. Fixes issue 92.
* Fix thread-safety errors. Fixes issue 90.
* Add SIMD power method. Fixes issue 94.
NVIDIA Texture Tools version 2.0.6
* Fix dll version checking.
* Detect CUDA 2.1 and future CUDA versions correctly.
* Print CUDA detection message in nvcompress.
* Select the fastest CUDA device.
* Compile squish with -fPIC. Fixes issue 74.
* Fix warnings under gcc 4.3.2.
* Fix nvzoom option typo by Frank Richter. Fixes issue 81.
* Do not use CUDA to compress small mipmaps. Fixes issue 76.
* Compute mipmaps of semi-transparent images correctly.
* Shutdown CUDA properly. Fixes issue 83.
* Fix pixel format converions. Fixes issue 87.
* Update single color compression tables. Fixes issue 85.
NVIDIA Texture Tools version 2.0.5
* Fix error in single color compressor. Fixes issue 66.
* Detect mismatch between CUDA runtime and driver, and disable CUDA in that case.
* Fix cmake files when compiling NVTT as a shared library.
* When linking nvtt dynamically on unix, link all libraries dynamically.
* Select fastest CUDA device.
NVIDIA Texture Tools version 2.0.4
* Fix error in RGB format output; reported by jonsoh. See issue 49.
* Added support RGB format dithering by jonsoh. Fixes issue 50 and 51.
* Prevent infinite loop in indexMirror when width equal 1. Fixes issue 65.
* Implement general scale filter, including upsampling.
NVIDIA Texture Tools version 2.0.3
* More accurate DXT3 compressor. Fixes issue 38.
* Remove legacy compressors. Fix issue 34.
* Check for single color in all compressors. Fixes issue 43.
* Fix error in fast downsample filter, reported by Noel Llopis.
NVIDIA Texture Tools version 2.0.2
* Fix copy ctor error reported by Richard Sim.
* Fix indexMirror error reported by Chris Lambert.
* Fix vc8 post build command, reported by Richard Sim.
* Fix RGBA modes with less than 32 bpp by Viktor Linder.
* Fix alpha decompression by Amorilia. See issue 40.
* Avoid default-initialized constructors for POD types, reported by Jim Tilander.
* Add single color compresor for DXT1a.
* Set swizzle code to ATI2 files. See issue 41.
NVIDIA Texture Tools version 2.0.1
* Fix memory leaks.
* Pre-allocate device memory for CUDA compressor.
* Add single color compressor. Thanks to Amir Ebrahimi.
* Better CUDA error checking.
NVIDIA Texture Tools version 2.0.0
* Fixed PSNR formula in nvimgdiff.
* Added support for arbitrary RGB formats.
* Add support for DXT1a. Solves issue 1.
* Refactor and improve compression quality of fast compressors.
* Add cmake scripts to detect processor and chose compiler options.
* Fix normal map decompression.
* Evaluate angular deviation error for normal maps in nvimgdiff.
* Fix DXT1 compression with custom color metrics.
* Fix error in normal map generation from heightmap mipmaps.
* Fix errors in estimateSize.
* Fix errors when maxLevel is used.
* Enable the use of BC5 not just for normal maps.
* Add mirror wrapping mode, use by default.
* Implement polyphase filters. Solves issue 3.
* Add box and triangle filter sampling.
* Refactor nvtt public interface.
* Add resizing input options (setMaxExtents, setRoundMode). Solves issue 12.
* Plain C and C# wrappers. Solves issue 22.
NVIDIA Texture Tools version 0.9.4
* Added support for input DDS files, including cube maps.
* Added support for input PSD files.
* Added nvdecompress tool.
* Added nvimgdiff tool.
* Added nvddsinfo tool.
* CUDA compressor 22% faster.
* DXT3 & DXT5 CUDA compressors.
* Faster DXT5n CPU compressor.
* Many bug fixes.
NVIDIA Texture Tools version 0.9.3
* Fix non power of two textures.
* Fix estimateSize with rgb format.
* Fix error in cuda compressor block limit.
NVIDIA Texture Tools version 0.9.2
* Improved alpha compression.
* Improved fast DXT1 compression.
* Documentation and release notes.
NVIDIA Texture Tools version 0.9.1
* Bug fix release.
NVIDIA Texture Tools version 0.9.0
* Private beta prerelease.

@ -0,0 +1,84 @@
# Introduction #
## nvcompress ##
Compresses the given image and produces a DDS file.
```
usage: nvcompress [options] infile [outfile]
Input options:
-color The input image is a color map (default).
-normal The input image is a normal map.
-tonormal Convert input to normal map.
-clamp Clamp wrapping mode (default).
-repeat Repeat wrapping mode.
-nomips Disable mipmap generation.
Compression options:
-fast Fast compression.
-nocuda Do not use cuda compressor.
-rgb RGBA format
-bc1 BC1 format (DXT1)
-bc1n BC1 normal map format (DXT1nm)
-bc1a BC1 format with binary alpha (DXT1a)
-bc2 BC2 format (DXT3)
-bc3 BC3 format (DXT5)
-bc3n BC3 normal map format (DXT5nm)
-bc4 BC4 format (ATI1)
-bc5 BC5 format (3Dc/ATI2)
```
## nvdecompress ##
Decompresses the given DDS file.
```
usage: nvdecompress ddsfile
```
## nvddsinfo ##
Outputs information about the given DDS file.
```
usage: nvddsinfo ddsfile
```
## nvimgdiff ##
```
usage: nvimgdiff [options] original_file updated_file
Diff options:
-normal Compare images as if they were normal maps.
-alpha Compare alpha weighted images.
```
## nvassemble ##
Create cubemap DDS files from multiple images.
```
usage: nvassemble [-cube|-volume|-array] 'file0' 'file1' ..
```
## nvzoom ##
Scales the given image.
```
usage: nvzoom [options] input [output]
Options:
-s scale Scale factor (default = 0.5)
-g gamma Gamma correction (default = 2.2)
-f filter One of the following: (default = 'box')
* box
* triangle
* quadratic
* bspline
* mitchell
* lanczos
* kaiser
```

@ -0,0 +1,142 @@
## Contents ##
* [Prerequisites](CompilationInstructions#Prerequisites.md)
* [Windows](CompilationInstructions#Windows.md)
* [Visual Studio 8](CompilationInstructions#Visual_Studio_8.md)
* [CMake and Visual Studio 7](CompilationInstructions#CMake_and_Visual_Studio_7.md)
* [CMake and Visual Studio 8](CompilationInstructions#CMake_and_Visual_Studio_8.md)
* [CMake and Visual Studio 10](CompilationInstructions#CMake_and_Visual_Studio_10.md)
* [Linux](CompilationInstructions#Linux.md)
* [Mac OSX](CompilationInstructions#Mac_OSX.md)
## Prerequisites ##
Project files are provided for Visual Studio 8. For all other platforms and targets you will need to install CMake. You can download it from:
http://www.cmake.org/cmake/resources/software.html
In order to compile the CUDA accelerated compressors you need to install CUDA:
http://www.nvidia.com/object/cuda_get.html
Note that CUDA is not free software and is not supported on all platforms.
In addition to that, the command line tools also need the following libraries:
* libpng
* libjpeg
* ...
Note that the sources already include these libraries precompiled for 32 bit windows.
## Windows ##
### Visual Studio 8 ###
Simply open the solution file:
```
projects/vc8/nvtt.sln
```
and build all (Ctrl + Shift + B).
### CMake and Visual Studio 7 ###
Run the following commands:
```
$ mkdir vc7
$ cd vc7
$ cmake .. -DNVTT_SHARED=1 -G "Visual Studio 7 2003 .NET"
```
open the generated solution file:
```
vc7/NV.sln
```
and build all (Ctrl + Shift + B).
### CMake and Visual Studio 8 ###
Run the following commands:
```
$ mkdir vc8
$ cd vc8
$ cmake .. -DNVTT_SHARED=1 -G "Visual Studio 8 2005"
```
open the generated solution file:
```
vc8/NV.sln
```
and build all (Ctrl + Shift + B).
### CMake and Visual Studio 10 ###
Run the following commands:
```
$ mkdir vc10
$ cd vc10
$ cmake .. -DNVTT_SHARED=1 -G "Visual Studio 10"
```
open the generated solution file:
```
vc10/NV.sln
```
and build all (Ctrl + Shift + B).
### CMake + MinGW ###
Note that CUDA does not currently support the MinGW compiler. This target is not supported yet, but may work if CUDA is not enabled.
## Linux ##
If you are running Debian or Ubuntu you can install the required libraries as follows:
```
sudo apt-get install ...
```
On other distributions you will have to use the corresponding package manager.
Then compile and install the sources as follows:
```
$ ./configure
$ make
$ sudo make install
```
## Mac OSX ##
Install the required libraries as follows:
```
$ sudo port install ...
```
Then compile and install the sources as follows:
```
$ ./configure
$ make
$ sudo make install
```

@ -0,0 +1,19 @@
DXT compression is an algorithm that is very sensitive to floating point precision.
The CUDA compressors generally produce slightly different results than the CPU compressors. Moreover, different CPU compilers generally produce different results as well. Even the same compiler can produce different outputs as well, depending on the target or the optimization settings. The best way to minimize these differences is setting the compiler floating point unit to single precision.
On Windows this can be achieved as follows:
```
#include <float.h>
...
_controlfp(_PC_24, _MCW_PC);
```
and on Linux and other Unixes:
```
#include <fpu_control.h>
...
_FPU_SETCW(0x7f|_FPU_RC_NEAREST|_FPU_SINGLE);
```

@ -0,0 +1,21 @@
# Introduction #
The best documentation for the new D3D11 formats is in the OpenGL BPTC spec:
http://www.opengl.org/registry/specs/ARB/texture_compression_bptc.txt
A good overview is available at:
http://www.reedbeta.com/blog/2012/02/12/understanding-bcn-texture-compression-formats/
# Compressors #
* NVIDIA Compressors written by Walt Donovan:
* https://code.google.com/p/nvidia-texture-tools/downloads/detail?name=bc6h_export.zip
* https://code.google.com/p/nvidia-texture-tools/downloads/detail?name=bc7_export.zip
* Volition GPU Compressor:
* https://github.com/volition-inc/bc7_gpu
* http://gamma.cs.unc.edu/FasTC/

@ -0,0 +1,27 @@
## References ##
Microsoft has some documentation available:
* Programming Guide for DDS:
> http://msdn.microsoft.com/en-us/library/bb943991.aspx
* Reference for DDS:
> http://msdn.microsoft.com/en-us/library/bb943992.aspx
* Compressed Texture Resources (Direct3D 9):
> http://msdn.microsoft.com/en-us/library/bb204843.aspx
* Block Compression (Direct3D 10):
> http://msdn.microsoft.com/en-us/library/bb694531.aspx
The OpenGL extensions also document the block compression formats:
* DXT1, DXT3 and DXT5 (equivalent to BC1, BC2 and BC3):
> http://www.opengl.org/registry/specs/EXT/texture_compression_s3tc.txt
* LATC and RGTC (equivalent to BC4 and BC5):
> http://www.opengl.org/registry/specs/EXT/texture_compression_latc.txt <br>
<blockquote><a href='http://www.opengl.org/registry/specs/EXT/texture_compression_rgtc.txt'>http://www.opengl.org/registry/specs/EXT/texture_compression_rgtc.txt</a></blockquote>
<ul><li>BPTC (equivalent to BC6 and BC7):<br>
</li></ul><blockquote><a href='http://www.opengl.org/registry/specs/ARB/texture_compression_bptc.txt'>http://www.opengl.org/registry/specs/ARB/texture_compression_bptc.txt</a>

@ -0,0 +1,34 @@
### Where can I ask questions? How can I get support? ###
You can ask questions about the usage of the Texture Tools at the [NVIDIA developer forums](http://developer.nvidia.com/forums/index.php?showforum=9). You can report bugs and request new features in our [issue database](http://code.google.com/p/nvidia-texture-tools/issues/list). If you are a developer and have questions about the API or the source code, feel free to drop by the [developer's mailing list](http://groups.google.com/group/nvidia-texture-tools). If you would like to contact us privately, please send an email to [TextureTools@nvidia.com](mailto:TextureTools@nvidia.com).
### Why is feature XYZ not supported? ###
In order to keep the code small and reduce maintenance costs we have limited the
features available in our new texture tools. For this reason, we have also open sourced the code, so that people can modify it and add their own custom features.
### What platforms do the NVIDIA Texture Tools support? ###
The tools are compiled and tested regularly on Linux, OSX, and Windows.
> Some platforms are tested more frequently than others and there may be bugs on some uncommon configurations.
### Is CUDA required? ###
No. The Visual Studio solution file contains a configuration that allows you
to compile the texture tools without CUDA support. The cmake scripts automatically
detect the CUDA installation and use it only when available.
Even if the texture tools are compiled with CUDA support it's possible to use
them on systems that do not support CUDA or that do not have a valid CUDA driver
installed.
### Where can I get CUDA? ###
At http://developer.nvidia.com/object/cuda.html
### Can I use the NVIDIA Texture Tools in my commercial application? ###
Yes, the NVIDIA Texture Tools are licensed under the MIT license.
### Can I use the NVIDIA Texture Tools in my GPL application? ###
Yes, the MIT license is compatible with the GPL and LGPL licenses.
### Can I use the NVIDIA Texture Tools in the US? Do I have to obtain a license of the S3TC patent (US patent 5,956,431)? ###
NVIDIA has a license of the S3TC patent that covers all our products, including our Texture Tools. You don't have to obtain a license of the S3TC patent to use any of NVIDIA's products, but certain uses of NVIDIA Texture Tools source code cannot be considered NVIDIA products anymore. Keep in mind that the NVIDIA Texture Tools are licensed under the MIT license and thus are provided without warranty of any kind.

@ -0,0 +1,48 @@
Charles Bloom compares [some of these techniques](http://cbloomrants.blogspot.com/2009/06/06-17-09-dxtc-more-followup.html) in more detail.
### YCoCg-DXT5 ###
A simple way of obtaining higher quality compression is also using the YCoCg color space, but encoding the Y component in the in the alpha channel of a DXT5 block, and the CoCg components in the RGB channels. That was originally suggested by Waveren in [Real-Time DXT Compression](http://www.intel.com/cd/ids/developer/asmo-na/eng/dc/index.htm). This approach was described in more detail by Waveren and Castano in [Real-Time YCoCg-DXT Compression](http://developer.nvidia.com/object/real-time-ycocg-dxt-compression.html).
### Humus' Compression ###
[Emil Persson (aka Humus)](http://www.humus.name) also has [a demo](http://www.humus.name/index.php?page=3D&ID=68) that implements a similar idea, but using YCbCr color space instead. He is actually using two textures, either one ATI1N (BC4/DXT5A) texture to store the luma (Y) and one ATI2N (BC5/3Dc) texture to store the chroma (CbCr), or one DXT1 texture to store the luma and one DXT5 (really DXT5nm) texture to store the chroma. The second texture that stores the chroma is a quarter the size to achieve a compression to 6 bits per pixel, as opposed to 8 bits per pixel for YCoCg DXT5. As shown in the figure below, the compression quality is not as good as YCoCg-DXT5. It also has lower performance, since it requires two texture lookups.
![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/humus.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/humus.png)
_Graph courtesy of J.M.P. van Waveren._
### Tom Forsyth's Compression ###
Another alternative is one suggested by [Tom Forsyth](http://www.eelpi.gotdns.org/):
One alternative I want to try is using two DXT1 textures with the same mapping and with one of them using the 1-bit alpha that you get for free. Then simply lerp between them. This allows each pixel to be one of three colours from tex0, or if tex0 is the alpha=0 colour, it can be one of 4 colours from tex1. Pixel shader is pretty simple:
```
tex t0
tex t1
lerp r0, t0.a, t0, t1
```
This approach is interesting, but according to Tom, it doesn't work that well in practice.
Instead he suggests doing something similar to Humus' compression, but using an uncompressed RGB-565 texture, and a separate luminance texture. The original texture is downsampled to 1/4th its size, and the luminance texture encodes the luminance difference between the original and the downsampled texture. The luminance deltas usually have a small range, so you could use a per texture scale factor to scale the deltas to the representable range, and obtain higher precision. Tom [explains it with more details on his blog](http://home.comcast.net/~tom_forsyth/blog.wiki.html#%5B%5BTexture%20formats%20for%20faster%20compression%5D%5D).
The advantage of this method is that compression is very fast, the downsampled texture is only quantized, and the luminance texture is 1D, so it has a small search space. He has not done any PSNR analysis, thought.
### Bungie Compression ###
The basic idea is to compress a texture once, compute the difference between the compressed texture and the original, and compress that difference again.
http://research.microsoft.com/research/pubs/view.aspx?tr_id=1198
https://www.cmpevents.com/GD08/a.asp?option=C&V=11&SessID=6221
### RGBV ###
This is a variant of RGBM using two DXT1 blocks in order to get free alpha mask.
http://files.wayforward.com/shane/rgbv/

@ -1,25 +0,0 @@
NVIDIA Texture Tools is licensed under the MIT license.
Copyright (c) 2009-2020 Ignacio Castaño
Copyright (c) 2007-2009 NVIDIA Corporation
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

@ -0,0 +1,9 @@
**This page is under construction!**
You can find the C bindings at:
http://code.google.com/p/nvidia-texture-tools/source/browse/trunk/src/nvtt/nvtt_wrapper.h
and the C# bindings at:
http://code.google.com/p/nvidia-texture-tools/source/browse/trunk/project/vc8/Nvidia.TextureTools/TextureTools.cs

@ -0,0 +1,19 @@
## References ##
* Jon Blow articles in Game Developer Magazine:
* [Mipmapping, Part 1](http://number-none.com/product/Mipmapping,%20Part%201/index.html)
* [Mipmapping, Part 2](http://number-none.com/product/Mipmapping,%20Part%202/index.html)
* [Non-Power-of-Two Mipmapping](http://developer.nvidia.com/object/np2_mipmapping.html)
## Conclusions ##
Here are some of my findings:
* Windowed sinc filters with radius greater than 3 produce too many ringing artifacts.
* For good results with non power of two textures or arbitrary scales, you must use polyphase filters.
* Sampling the polyphase filter with a box filter greatly improves the quality.
* Using a triangle filter looks even better, but the difference is small.
* For most cases box does a great job.
* The Lanczos and Kaiser windows produce indistinguishable results.
* Gamma correction produces more correct results, but sometimes enhances the ringing artifacts.

@ -0,0 +1,12 @@
# HDR #
## LogLUV ##
* http://graphicrants.blogspot.com/2009/04/rgbm-color-encoding.html
* http://realtimecollisiondetection.net/blog/?p=15
## RGBM ##
* http://graphicrants.blogspot.com/2009/04/rgbm-color-encoding.html
* Bungie compressor is based on this paper: http://www.ppsloan.org/publications/HDRComp.pdf
* Also used in Lost Planet
![http://game.watch.impress.co.jp/docs/20070131/3dlp111.jpg](http://game.watch.impress.co.jp/docs/20070131/3dlp111.jpg)
![http://game.watch.impress.co.jp/docs/20070131/3dlp113.jpg](http://game.watch.impress.co.jp/docs/20070131/3dlp113.jpg)

@ -0,0 +1,45 @@
J.M.P. van Waveren's paper has a much more detailed analysis of the different ways a normal map can be compressed:
[Real-Time Normal Map DXT Compression](http://developer.nvidia.com/object/real-time-normal-map-dxt-compression.html)
Another interesting (but not so detailed) article on the topic is:
http://www.ozone3d.net/tutorials/bump_map_compression.php
### DXT5nm ###
This format was introduced in the original nvdxt library and since then it has become quite popular. It uses a DXT5 block to represent normals, storing the X component in the Alpha and the Y component in the Green channel.
### RXGB ###
The DOOM 3 engine and its derivates use the so called RXGB format, that is just like DXT5, but with the Red and Alpha components swapped, which means that the normal is given by the (a, g, b) components.
### BC5 ###
BC5 is a two component block compression format, where each component is represented with a DXT5 alpha block. It was originally called 3Dc by ATI and its main purpose was to encode normals storing only the X and Y components.
In DirectX 10 the 3Dc format was standarized and renamed to BC5.
BC5 can be loaded in OpenGL as LATC or RGTC. The LATC format is particularly convenient, because you can use the same swizzle that is used for DXT5nm, that's because the luminance is replicated in the RGB components.
### Capcon's DXT trick ###
As described by [Christer Ericson](http://realtimecollisiondetection.net/blog/?page_id=2) in [his blog](http://realtimecollisiondetection.net/blog/?p=28):
> One clever thing they do (as mentioned on these two slides) is to encode their normal maps so that you can feed either a DXT1 or DXT5 encoded normal map to a shader, and the shader doesnt have to know. This is neat because it cuts down on shader permutations for very little shader cost. Their trick is for DXT1 to encode X in R and Y in G, with alpha set to 1. For DXT5 they encode X in alpha, Y in G, and set R to 1. Then in the shader, regardless of texture encoding format, they reconstruct the normal as `X = R * alpha`, `Y = G`, `Z = Sqrt(1 - X^2 - Y^2)`.
> A DXT5-encoded normal map has much better quality than a DXT1-encoded one, because the alpha component of DXT5 is 8 bits whereas the red component of DXT1 is just 5 bits, but more so because the alpha component of a DXT5 texture is compressed independently from the RGB components (the three of which are compressed dependently for both DXT1 and DXT5) so with DXT5 we avoid co-compression artifacts. Of course, the cost is that the DXT5 texture takes twice the memory of a DXT1 texture (plus, on the PS3, DXT1 has some other benefits over DXT5 that I dont think I can talk about).
### Alternative Projections ###
Usually 3D normals are stored using only two components and the normal is reconstructed using an orthogonal projection:
`z = sqrt(1 - x*x - y*y)`
This is easy to compute on your shaders and has the advantage of providing more detail near the top of the hemisphere, that is flat normals are represented more accurately.
The main disadvantage is that the reconstruction is done after interpolation and unfortunately lines in 2D do not map to great circles when using this projection, and that can potentially cause interpolation artifacts.
Another approach is to use a stereographic projection. This projection has a slightly better behavior under interpolation and is only slightly more expensive. The distribution of normals is also more uniform, although it's not clear whether that's good or not.

@ -0,0 +1,45 @@
![http://www.nvidia.com/content/images/nvidia-logo.jpg](http://www.nvidia.com/content/images/nvidia-logo.jpg)
The [NVIDIA Texture Tools](http://developer.nvidia.com/object/texture_tools.html) is a collection of image processing and texture manipulation tools, designed to be integrated in game tools and asset conditioning pipelines.
The primary features of the library are mipmap and normal map generation, format conversion and DXT compression.
DXT compression is based on [Simon Brown's squish library](http://code.google.com/p/libsquish/). The library also contains an alternative GPU-accelerated compressor that uses [CUDA](http://developer.nvidia.com/object/cuda.html) and is one order of magnitude faster.
## News ##
**May 14, 2010**
[NVIDIA Texture Tools 2.0.8](http://code.google.com/p/nvidia-texture-tools/downloads/detail?name=nvidia-texture-tools-2.0.8-1.tar.gz) is released. This is a bug fix release. [Changes in version 2.0.8](http://code.google.com/p/nvidia-texture-tools/source/browse/tags/2.0.8/ChangeLog).
**November 4, 2009**
[NVIDIA Texture Tools 2.0.7](http://code.google.com/p/nvidia-texture-tools/downloads/detail?name=nvidia-texture-tools-2.0.7-1.tar.gz) is released. This is a bug fix release. [Changes in version 2.0.7](http://code.google.com/p/nvidia-texture-tools/source/browse/tags/2.0.7/ChangeLog).
**March 19, 2009**
[NVIDIA Texture Tools 2.0.6](http://code.google.com/p/nvidia-texture-tools/downloads/detail?name=nvidia-texture-tools-2.0.6.tar.gz) is released. This is a stable release with numerous bug fixes. [Changes in version 2.0.6](http://code.google.com/p/nvidia-texture-tools/source/browse/tags/2.0.6/ChangeLog).
**December 01, 2008**
[NVIDIA Texture Tools 2.0.5](http://code.google.com/p/nvidia-texture-tools/downloads/detail?name=nvidia-texture-tools-2.0.5.tar.gz) is released. This is a bug fix release. [Changes in version 2.0.5](http://code.google.com/p/nvidia-texture-tools/source/browse/tags/2.0.5/ChangeLog).
**October 06, 2008**
[NVIDIA Texture Tools 2.0.4](http://code.google.com/p/nvidia-texture-tools/downloads/detail?name=nvidia-texture-tools-2.0.4.tar.gz) is released. This is a bug fix release. [Changes in version 2.0.4](http://code.google.com/p/nvidia-texture-tools/source/browse/tags/2.0.4/ChangeLog).
**June 09, 2008**
[NVIDIA Texture Tools 2.0.3](http://code.google.com/p/nvidia-texture-tools/downloads/detail?name=nvidia-texture-tools-2.0.3.tar.gz) is released. This is a bug fix release. [Changes in version 2.0.3](http://code.google.com/p/nvidia-texture-tools/source/browse/tags/2.0.3/ChangeLog).
**April 17, 2008**
[NVIDIA Texture Tools 2.0.2](http://code.google.com/p/nvidia-texture-tools/downloads/detail?name=nvidia-texture-tools-2.0.2.tar.gz) is released. This is a bug fix release. [Changes in version 2.0.2](http://code.google.com/p/nvidia-texture-tools/source/browse/tags/2.0.2/ChangeLog).
**February 28, 2008**
[NVIDIA Texture Tools 2.0.1](http://code.google.com/p/nvidia-texture-tools/downloads/detail?name=nvidia-texture-tools-2.0.1.tar.gz) is released. This is a bug fix release. [Changes in version 2.0.1](http://code.google.com/p/nvidia-texture-tools/source/browse/tags/2.0.1/ChangeLog).
**February 11, 2008**
[NVIDIA Texture Tools 2.0.0](http://code.google.com/p/nvidia-texture-tools/downloads/detail?name=nvidia-texture-tools-2.0.0.tar.gz) is released. This is a stable release with new features and many bug fixes. [Changes in version 2.0.0](http://code.google.com/p/nvidia-texture-tools/source/browse/tags/2.0.0/ChangeLog).

@ -0,0 +1,33 @@
The [NVIDIA Texture Tools](http://developer.nvidia.com/object/texture_tools.html) are being used by game development studios, indie game developers, hobbyist and students. Below are brief descriptions of some of the projects that use the NVIDIA Texture Tools. If you know about any other project or studio that's using them and is not listed here, please [let us know](http://groups.google.com/group/nvidia-texture-tools)!
---
* [Unreal® Engine 3](http://www.unrealtechnology.com/technology.php), _Epic Games Inc._
> Unreal® Engine 3 is a complete development framework for DirectX 10-equipped PCs, Xbox 360® and PLAYSTATION®3, providing the vast array of core technologies, content creation tools, and support infrastructure required by top game studios, advanced visualization and simulation developers and creators of 3D animated content for linear productions.
* [F-TexTools 2.0 / NmTools 2.0](http://forum.celestialmatters.org/viewtopic.php?t=273), _Fridger Schrempp, Robert Skuridin_
> Cross-platform tools optimized for accurate processing of huge scientific imaging data on regular computers, and generate textures that can be visualized in [Celestia](http://www.shatters.net/celestia/), a free space simulation that lets you explore our universe in three dimensions.
* [Blender](http://www.blender.org), _Amorilia_
> Blender is an open source, cross platform suite of tools for 3D creation. Since [version 2.46](http://www.blender.org/development/release-logs/blender-246/) Blender supports loading of DDS textures by using the NVIDIA Texture Tool's source code.
* [Overgrowth](http://www.wolfire.com/overgrowth), _[Wolfire Games](http://www.wolfire.com/overgrowth)_
> Overgrowth is a 3d action-adventure game for Mac, Windows, and Linux, coming soon from the independent game studio, Wolfire Games.
* [Rigs Of Rods](http://rigsofrods.com/), _Pierre-Michel Ricordel_
> Rigs of Rods (also known as RoR), is a truck, car, airplane and boat simulator.
* [NVIDIA Texture Tools for Maya](http://www.aardolino.com/MELscripts.html), _Alessandro Ardolino_
> A MEL interface to convert Maya textures to DDS using the industry standard tools from NVIDIA.
* [0 A.D.](http://wildfiregames.com/0ad/), _Wildfire Games_, _Philip Taylor_
> 0 A.D. is a cross-platform open source RTS game that uses NVTT to generate consistent DDS files. NVTT is bundled in the runtime, which allows users to modify and create new textures that are automatically processed for use in the game with no extra effort.

@ -0,0 +1,48 @@
A typical problem when using DXT compression is that it's not possible to obtain pure greys (the same applies to any format that stores RGB colors in 565 bits). This is usually a problem when compressing lightmaps, since white light results in colored patches. However, that can be avoided transforming the colors to YCoCg-R color space as follows:
```
Co = R-B;
t = B + (Co/2);
Cg = G-t;
Y = t + (Cg/2);
s = Y - (Cg / 2);
G = Cg + s;
B = s - (Co / 2);
R = B + Co;
```
An even cheaper alternative is to use the JPEG-LS transform:
```
(R-G, G, B-G)
```
It might not be obvious why that works, but with the following code
it's easy to test that pure greys remain pure greys after the transform:
```
for(int i = 0; i < 256; i++)
{
int R = i;
int G = i;
int B = i;
int a = (R - G + 255) / 2;
int b = G;
int c = (B - G + 255) / 2;
// Quantize/bitexpand colors.
a = ((a >> 3) << 3) | (a >> 5);
b = ((b >> 2) << 2) | (b >> 6);
c = ((c >> 3) << 3) | (c >> 5);
R = (2 * (a - 123)) + b;
G = b;
B = (2 * (c - 123)) + b;
printf("%d: %d %d %d\n", i, R, G, B);
}
```
Note that signed components are packed as unsigned integers, so they need to be scaled and biased. In order to obtain pure greys, the bias that you have to use to reconstruct the color is equal to 255/2 quantized to 5 bits, that's why 123 is used. While this method allows you to obtain pure greys, it introduces more errors in the colors away from grey. So, it may not always be a good idea to use it.

@ -1,83 +0,0 @@
# NVTT is discontinued
After more than 14 years maintaining and updating this library on my spare time, I've decided to officially discontinue it and focus my energy on other projects.
When I released NVTT there was very little public information about compression for GPU texture formats. Existing codecs were closed-source, encumbered by patents, and not particularly efficient or high quality. A lot has changed since then. NVTT doesn't support the latest formats anymore, some of its codecs are outdated, and it's source code has aged. Today most IHVs maintain their own open source codecs and several companies develop high quality commercial products around texture compression.
If you are looking for alternative texture compression tools and processing algorithms I recommend you check these out:
## Open Source Encoders
* I still maintain [A High Quality SIMD BC1 Encoder](https://github.com/castano/icbc).
* [rgbcx](https://github.com/richgel999/bc7enc/blob/master/rgbcx.h) is another high-performance (but scalar) BC1-5 encoder.
* [stb_dxt](https://github.com/nothings/stb/blob/master/stb_dxt.h) is a single header library that provides low quality, but fast BC1-5 encoders.
* [Binomial](https://www.binomial.info/) is an image and texture compression company that develops [Basis a universal texture codec](https://github.com/BinomialLLC/basis_universal) and also has [other open source codecs](https://github.com/BinomialLLC).
* [Intel ISPC Texture Compressor](https://github.com/GameTechDev/ISPCTextureCompressor) is a set of set of open source SIMD texture encoders that are very fast, but low quality.
* [AMD Compressonator](https://gpuopen.com/compressonator/) offers various open source encoders that also run on the GPU.
* [Betsy](https://github.com/darksylinc/betsy/) is a compressor for various GPU formats using compute shaders.
* For ETC encoders see Google's [Etc2Comp](https://github.com/google/etc2comp), Bartosz Taudul's [etcpak](https://github.com/wolfpld/etcpak) and Rich Geldreich's [rg-etc1](https://github.com/richgel999/rg-etc1).
* [ARM ASTC Encoder](https://github.com/ARM-software/astc-encoder) is an excellent ASTC encoder.
* This is [a good overview of the state of texture encoders in 2020](https://aras-p.info/blog/2020/12/08/Texture-Compression-in-2020/).
## Image Processing and IO
* [stb_image_resize](https://github.com/nothings/stb/blob/master/stb_image_resize.h) provides polyphase image resize filters that are similar to what NVTT supports.
* [Dario Manesku's cube map filtering tool](https://github.com/dariomanesku/cmft) seems like a good alternative for the cube map filtering functions in NVTT.
* [CubeMapGen](https://gpuopen.com/archived/cubemapgen/) is another source of information for cubemap filtering algorithms, but is now unsupported as well.
* Deano Calver supports [three tiny libraries](https://deanoc.com/2019/09/tiny) that provide support for DDS and KTX file formats, and pixel format conversion.
* [stb_image](https://github.com/nothings/stb/blob/master/stb_image.h) and [stb_image_write](https://github.com/nothings/stb/blob/master/stb_image_write.h) are two handy single header libraries to read and write images in various formats.
* https://github.com/syoyo/tinyexr
* https://lodev.org/lodepng/
* [texturec](https://bkaradzic.github.io/bgfx/tools.html#texture-compiler-texturec) is a handy command line tool similar to `nvcompress`, built on top of [bimg](https://github.com/bkaradzic/bimg).
* The venerable [ImageMagick](https://imagemagick.org/) still provides many valuable tools and utilities.
## Commercial Libraries
* [Oodle Texture](http://www.radgametools.com/oodletexture.htm) is a suite of commercial RDO texture codecs.
* [NVIDIA Texture Tools exporter](https://developer.nvidia.com/nvidia-texture-tools-exporter) is based on a private fork of this project and offers additional GPU accelerated codecs, but it's not open source.
-------------------------------
# NVIDIA Texture Tools [![Actions Status](https://github.com/castano/nvidia-texture-tools/workflows/build/badge.svg)](https://github.com/castano/nvidia-texture-tools/actions) ![MIT](https://img.shields.io/badge/license-MIT-blue.svg) [![GitHub](https://img.shields.io/badge/repo-github-green.svg)](https://github.com/castano/nvidia-texture-tools)
The NVIDIA Texture Tools is a collection of image processing and texture
manipulation tools, designed to be integrated in game tools and asset
processing pipelines.
The primary features of the library are mipmap and normal map generation, format
conversion, and DXT compression.
### How to build (Windows)
Use the provided Visual Studio 2017 solution `project/vc2017/thekla.sln`.
### How to build (Linux/OSX)
Use [cmake](http://www.cmake.org/) and the provided configure script:
```bash
$ ./configure
$ make
$ sudo make install
```
### Using NVIDIA Texture Tools
To use the NVIDIA Texture Tools in your own applications you just have to
include the following header file:
[src/nvtt/nvtt.h](https://github.com/castano/nvidia-texture-tools/blob/master/src/nvtt/nvtt.h)
And include the nvtt library in your projects.
The following file contains a simple example that shows how to use the library:
[src/nvtt/tools/compress.cpp](https://github.com/castano/nvidia-texture-tools/blob/master/src/nvtt/tools/compress.cpp)
Detailed documentation of the API can be found at:
https://github.com/castano/nvidia-texture-tools/wiki/ApiDocumentation

@ -0,0 +1,46 @@
The compressors available in the NVIDIA Texture Tools are not designed for real-time compression. If you need to compress textures in real-time, I'd recommend to look at the following sources:
[J.M.P. van Waveren](http://mrelusive.com) was the first one to describe a [real-time DXT compressor](http://www.intel.com/cd/ids/developer/asmo-na/eng/dc/index.htm). This compressor is part of the of [real-time texture streaming pipeline](http://softwarecommunity.intel.com/UserFiles/en-us/Image/1221/Real-Time%20Texture%20Streaming%20&%20Decompression.pdf) used in some [id Software](http://www.idsoftware.com) games. He obtains the following results with his SSE2 optimized implementation:
| **CPU** | **DXT1** | **DXT5** |
|:--------|:---------|:---------|
| Intel 2.8 GHz Dual Core Xeon | 112.05 MP/s | 66.43 MP/s |
| Intel 2.9 GHz Core 2 Extreme | 200.62 MP/s | 127.55 MP/s |
The same algorithm described by Waveren can also be adapted easily to the GPU. This is what Simon Green did in [this OpenGL SDK example](http://developer.download.nvidia.com/SDK/10/opengl/samples.html#compress_DXT). The performance on the GPU is much more impressive:
| **GPU** | **DXT1** | **DXT5** |
|:--------|:---------|:---------|
| GeForce 8800 GTX | 1,547 MP/s | - |
| GeForce 8600 GTS | 461 MP/s | - |
A later [whitepaper](http://developer.nvidia.com/object/real-time-ycocg-dxt-compression.html) by Waveren and [Ignacio Castaño](http://castano.ludicon.com) provides even higher results on the GPU:
| **GPU** | **DXT1** | **YCoCg-DXT5** |
|:--------|:---------|:---------------|
| GeForce 8800 GTX | 1,690 MP/s | 939 MP/s |
| GeForce 8600 GTS | 520 MP/s | 279 MP/s |
Peter Uliciansky optimized Waveren's algorithm further and published his results in this thread: [Extreme DXT Compression, New algorithm for real-time DXT compression](http://developer.nvidia.com/forums/index.php?showtopic=1737).
| **CPU** | **DXT1** | **DXT5** |
|:--------------------------|:-------------|:-------------|
| Intel Pentium 4 2.8 GHz | 241.2 MP/s | 206.5 MP/s |
| Intel Core 2 3.0 GHz | 910.0 MP/s | 620.4 MP/s |
These numbers are very impressive and start to get closer to the results of the GPU implementation. However, as pointed by [Charles Bloom](http://www.cbloom.com/) this implementation has [some errors](http://cbloomrants.blogspot.com/2008/11/11-18-08-dxtc.html).
Moreover, the latest GPU implementation also offers higher performance.
* http://developer.download.nvidia.com/SDK/10/opengl/samples.html#compress_YCoCgDXT
* http://developer.download.nvidia.com/SDK/10/opengl/samples.html#compress_NormalDXT
| **GPU** | **DXT1** | **YCoCg-DXT5** | **BC5** | **DXT5n** |
|:--------------------|:-------------|:---------------|:-------------|:-------------|
| GeForce 8800 GTX | 3450 MP/s | 1880 MP/s | 5665 MP/s | 5804 MP/s |
| GeForce GTX 280 | 9920 MP/s | 7900 MP/s | 12850 MP/s | 13150 MP/s |
Other links:
* https://mollyrocket.com/forums/viewtopic.php?t=392
* http://www.evl.uic.edu/cavern/fastdxt/

@ -0,0 +1,146 @@
## Introduction ##
This page demonstrates the results of resampling different images using various resize filters.
Images used for the test:
| ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3.jpg](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3.jpg) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5.jpg](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5.jpg) |
|:------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------|
The width of the filters are:
| **Box** | **Triangle** | **Quadratic** | **Lanczos** | **Kaiser** |
|:--------|:-------------|:--------------|:------------|:-----------|
| 0.5 | 1.0 | 1.5 | 3.0 | 5.0 |
The parameters used for the Kaiser filter are:
```
alpha = 4
stretch = 1
```
## Test 1 ##
Downsampling without gamma correction.
### 0.7 scale factor ###
| **Box** | **Triangle** | **Quadratic** | **Lanczos** | **Kaiser** |
|:--------|:-------------|:--------------|:------------|:-----------|
| ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_07_box.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_07_box.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_07_triangle.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_07_triangle.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_07_quadratic.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_07_quadratic.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_07_lanczos.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_07_lanczos.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_07_kaiser.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_07_kaiser.png) |
### 0.5 scale factor ###
| **Box** | **Triangle** | **Quadratic** | **Lanczos** | **Kaiser** |
|:--------|:-------------|:--------------|:------------|:-----------|
| ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_05_box.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_05_box.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_05_triangle.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_05_triangle.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_05_quadratic.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_05_quadratic.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_05_lanczos.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_05_lanczos.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_05_kaiser.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_05_kaiser.png) |
### 0.3 scale factor ###
| **Box** | **Triangle** | **Quadratic** | **Lanczos** | **Kaiser** |
|:--------|:-------------|:--------------|:------------|:-----------|
| ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_03_box.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_03_box.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_03_triangle.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_03_triangle.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_03_quadratic.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_03_quadratic.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_03_lanczos.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_03_lanczos.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_03_kaiser.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test1_03_kaiser.png) |
## Test 2 ##
Downsampling with gamma correction. Gamma is set to 2.2.
### 0.7 scale factor ###
| **Box** | **Triangle** | **Quadratic** | **Lanczos** | **Kaiser** |
|:--------|:-------------|:--------------|:------------|:-----------|
| ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_07_box.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_07_box.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_07_triangle.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_07_triangle.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_07_quadratic.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_07_quadratic.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_07_lanczos.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_07_lanczos.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_07_kaiser.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_07_kaiser.png) |
### 0.5 scale factor ###
| **Box** | **Triangle** | **Quadratic** | **Lanczos** | **Kaiser** |
|:--------|:-------------|:--------------|:------------|:-----------|
| ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_05_box.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_05_box.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_05_triangle.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_05_triangle.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_05_quadratic.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_05_quadratic.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_05_lanczos.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_05_lanczos.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_05_kaiser.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_05_kaiser.png) |
### 0.3 scale factor ###
| **Box** | **Triangle** | **Quadratic** | **Lanczos** | **Kaiser** |
|:--------|:-------------|:--------------|:------------|:-----------|
| ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_03_box.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_03_box.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_03_triangle.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_03_triangle.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_03_quadratic.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_03_quadratic.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_03_lanczos.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_03_lanczos.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_03_kaiser.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test2_03_kaiser.png) |
## Test 3 ##
Downsampling without gamma correction.
### 0.7 scale factor ###
| **Box** | **Triangle** | **Quadratic** | **Lanczos** | **Kaiser** |
|:--------|:-------------|:--------------|:------------|:-----------|
| ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_07_box.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_07_box.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_07_triangle.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_07_triangle.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_07_quadratic.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_07_quadratic.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_07_lanczos.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_07_lanczos.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_07_kaiser.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_07_kaiser.png) |
### 0.5 scale factor ###
| **Box** | **Triangle** | **Quadratic** | **Lanczos** | **Kaiser** |
|:--------|:-------------|:--------------|:------------|:-----------|
| ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_05_box.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_05_box.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_05_triangle.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_05_triangle.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_05_quadratic.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_05_quadratic.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_05_lanczos.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_05_lanczos.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_05_kaiser.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_05_kaiser.png) |
### 0.3 scale factor ###
| **Box** | **Triangle** | **Quadratic** | **Lanczos** | **Kaiser** |
|:--------|:-------------|:--------------|:------------|:-----------|
| ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_03_box.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_03_box.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_03_triangle.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_03_triangle.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_03_quadratic.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_03_quadratic.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_03_lanczos.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_03_lanczos.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_03_kaiser.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test3_03_kaiser.png) |
## Test 4 ##
Downsampling with gamma correction. Gamma is set to 2.2.
### 0.7 scale factor ###
| **Box** | **Triangle** | **Quadratic** | **Lanczos** | **Kaiser** |
|:--------|:-------------|:--------------|:------------|:-----------|
| ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_07_box.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_07_box.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_07_triangle.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_07_triangle.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_07_quadratic.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_07_quadratic.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_07_lanczos.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_07_lanczos.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_07_kaiser.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_07_kaiser.png) |
### 0.5 scale factor ###
| **Box** | **Triangle** | **Quadratic** | **Lanczos** | **Kaiser** |
|:--------|:-------------|:--------------|:------------|:-----------|
| ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_05_box.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_05_box.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_05_triangle.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_05_triangle.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_05_quadratic.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_05_quadratic.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_05_lanczos.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_05_lanczos.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_05_kaiser.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_05_kaiser.png) |
### 0.3 scale factor ###
| **Box** | **Triangle** | **Quadratic** | **Lanczos** | **Kaiser** |
|:--------|:-------------|:--------------|:------------|:-----------|
| ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_03_box.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_03_box.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_03_triangle.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_03_triangle.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_03_quadratic.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_03_quadratic.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_03_lanczos.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_03_lanczos.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_03_kaiser.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test4_03_kaiser.png) |
## Test 5 ##
Downsampling with gamma correction. Gamma is set to 2.2.
### 0.7 scale factor ###
| **Box** | **Triangle** | **Quadratic** | **Lanczos** | **Kaiser** |
|:--------|:-------------|:--------------|:------------|:-----------|
| ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_07_box.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_07_box.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_07_triangle.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_07_triangle.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_07_quadratic.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_07_quadratic.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_07_lanczos.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_07_lanczos.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_07_kaiser.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_07_kaiser.png) |
### 0.5 scale factor ###
| **Box** | **Triangle** | **Quadratic** | **Lanczos** | **Kaiser** |
|:--------|:-------------|:--------------|:------------|:-----------|
| ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_05_box.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_05_box.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_05_triangle.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_05_triangle.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_05_quadratic.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_05_quadratic.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_05_lanczos.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_05_lanczos.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_05_kaiser.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_05_kaiser.png) |
### 0.3 scale factor ###
| **Box** | **Triangle** | **Quadratic** | **Lanczos** | **Kaiser** |
|:--------|:-------------|:--------------|:------------|:-----------|
| ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_03_box.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_03_box.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_03_triangle.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_03_triangle.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_03_quadratic.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_03_quadratic.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_03_lanczos.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_03_lanczos.png) | ![http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_03_kaiser.png](http://nvidia-texture-tools.googlecode.com/svn/wiki/imgs/test5_03_kaiser.png) |

@ -0,0 +1,48 @@
Here's a rough roadmap for the next releases of the NVIDIA Texture Tools:
# 2.1 #
Completed features:
* ~~Support for linear color transforms and swizzles: [Issue 4](http://code.google.com/p/nvidia-texture-tools/issues/detail?id=4)~~
* ~~Migration to CUDA 2.0: [Issue 46](http://code.google.com/p/nvidia-texture-tools/issues/detail?id=46)~~
* ~~Support for alpha premultiplication. [Issue 30](http://code.google.com/p/nvidia-texture-tools/issues/detail?id=30)~~
* ~~Output AMD swizzle codes in DDS headers.~~
In progress:
* Major refactoring and cleanup.
* ~~Support for different alpha modes: [Issue 30](http://code.google.com/p/nvidia-texture-tools/issues/detail?id=30)~~
* Support for floating point formats: [Issue 27](http://code.google.com/p/nvidia-texture-tools/issues/detail?id=27)
* Support for YCoCg color transform: [Issue 18](http://code.google.com/p/nvidia-texture-tools/issues/detail?id=18)
Optional features:
* DXT1n support: [Issue 21](http://code.google.com/p/nvidia-texture-tools/issues/detail?id=21)
* CTX1 support: [Issue 21](http://code.google.com/p/nvidia-texture-tools/issues/detail?id=21)
* Add option to disable single color compressor: [Issue 53](http://code.google.com/p/nvidia-texture-tools/issues/detail?id=53)
* Image viewer (nvdisplay): [Issue 53](http://code.google.com/p/nvidia-texture-tools/issues/detail?id=53)
# 2.2 #
Planned features:
* More CUDA accelerated compressors and image processing operations. [Issue 29](http://code.google.com/p/nvidia-texture-tools/issues/detail?id=29)
* Support for DX11 compression formats.
* RGBE output format: [Issue 57](http://code.google.com/p/nvidia-texture-tools/issues/detail?id=57)
* Simple tone mapping options: [Issue 58](http://code.google.com/p/nvidia-texture-tools/issues/detail?id=58)
* Better support for DX10 style DDS files: [Issue 41](http://code.google.com/p/nvidia-texture-tools/issues/detail?id=41)
Optional features:
* Win64 image loaders: [Issue 31](http://code.google.com/p/nvidia-texture-tools/issues/detail?id=31)
* Better command line parsing and more command line options.
* Experimental lower level interface.
# 2.3 #
Planned features:
* Use CUDA driver interface: [Issue 25](http://code.google.com/p/nvidia-texture-tools/issues/detail?id=25)
* Photoshop plugin: [Issue 33](http://code.google.com/p/nvidia-texture-tools/issues/detail?id=33)

@ -0,0 +1,10 @@
[Simon Brown](http://www.sjbrown.co.uk/) describes a [single color compressor](http://www.sjbrown.co.uk/?article=dxt) as implemented in the [squish library](http://www.sjbrown.co.uk/?code=squish).
[ryg](http://www.farbrausch.de/~fg/)'s [fast, decent-quality DXT compressor](https://mollyrocket.com/forums/viewtopic.php?t=392) also uses a similar algorithm, but more optimized:
[ryg wrote](https://mollyrocket.com/forums/viewtopic.php?p=1995#1995):
> ...the code also uses an optimization similar to Simon's optimal single color fit, but with far smaller tables and no searching at all. It's based on two relatively simple observations: first, there's no point in trying out the indices representing the extreme values; even if they turn out to be optimal, you can get the exact same results by setting min=max for that component and using one of the "inbetween" indices. And second, the other two cases are symmetric; you get the same results by swapping min and max and using the opposite index. So if your block contains only one color, you don't need to search at all - just use index 2 (or 3) everywhere and use one table lookup in a 256-entry table to determine the optimal min/max color values to use. (Ok, actually, you need two tables, because R and B use 5 bits and G uses 6; but they're still quite small).
[ryg wrote](https://mollyrocket.com/forums/viewtopic.php?p=2000#2000):
> I originally didn't have it either, but later added it because it turned out to be very useful for textures that contain "vector graphics" where you have lots of single-colored areas with antialiased edges; the blocks with edges in them are tricky to get right, of course, but the solid color areas are easy. However, in the dithering variants, "not quite hitting" the right color is annoying because it generates very visible regular dithering patterns all over the solid areas (without dithering, it just gives you a uniform color that is somewhat off, which is obviously not nearly as bad). Anyway, the point was that I had to detect that case no matter what (to at least turn off dithering if nothing else), so why not do it properly :).

@ -0,0 +1,33 @@
# Image Sets #
* [Kodak image set](http://www.r0k.us/graphics/kodak/)
* [Waterloo image set](http://links.uwaterloo.ca/Repository.html):
1. [clegg.png](http://nvidia-texture-tools.googlecode.com/svn/trunk/data/testsuite/waterloo/clegg.png)
1. [frymire.png](http://nvidia-texture-tools.googlecode.com/svn/trunk/data/testsuite/waterloo/frymire.png)
1. [lena.png](http://nvidia-texture-tools.googlecode.com/svn/trunk/data/testsuite/waterloo/lena.png)
1. [monarch.png](http://nvidia-texture-tools.googlecode.com/svn/trunk/data/testsuite/waterloo/monarch.png)
1. [peppers.png](http://nvidia-texture-tools.googlecode.com/svn/trunk/data/testsuite/waterloo/peppers.png)
1. [sail.png](http://nvidia-texture-tools.googlecode.com/svn/trunk/data/testsuite/waterloo/sail.png)
1. [serrano.png](http://nvidia-texture-tools.googlecode.com/svn/trunk/data/testsuite/waterloo/serrano.png)
1. [tulips.png](http://nvidia-texture-tools.googlecode.com/svn/trunk/data/testsuite/waterloo/tulips.png)
* [Epic image set](http://udn.epicgames.com/Two/TextureComparison.html)
* [Farbrausch image set](http://www.farbrausch.de/~fg/dxt/testimg/)
* Witness image set
# Color Compression #
![http://chart.apis.google.com/chart?chs=480x240&cht=lc&chma=30,10,10|0,40&chxt=x,y&chxtc=0,-1000|1,-1000&chxr=0,1,24,1|1,0,0.05,0.01&chdlp=b&chco=3D7930,952826,3D1FC1,FF9900&chls=2|2|2|2&chds=0,0.05,0,0.05,0,0.05,0,0.05&chdl=BC1|BC3-YCoCg|BC3-RGBM|BC3-LUVW&chtt=Kodak%20-%20DXT%20Color&chd=t:0.032624,0.024178,0.018952,0.022459,0.038008,0.028139,0.022829,0.040354,0.020851,0.020663,0.026520,0.018902,0.042782,0.032700,0.023022,0.019964,0.021730,0.031479,0.025946,0.021485,0.028086,0.025337,0.019347,0.033181|0.016332,0.010590,0.009266,0.010276,0.018925,0.013797,0.011330,0.020442,0.010445,0.010226,0.012708,0.009413,0.021023,0.015484,0.010779,0.009729,0.010694,0.015803,0.013372,0.011113,0.013911,0.012687,0.009987,0.015965|0.016881,0.017722,0.011416,0.014217,0.021127,0.014887,0.013463,0.021504,0.011566,0.011493,0.014343,0.011181,0.022516,0.017143,0.014742,0.010352,0.011096,0.017569,0.014062,0.011941,0.014511,0.014100,0.010835,0.017031|0.019391,0.017771,0.013345,0.015694,0.022364,0.018262,0.015737,0.023361,0.014513,0.013768,0.016048,0.015395,0.024690,0.018457,0.016748,0.013119,0.013150,0.018914,0.016672,0.016551,0.017045,0.016356,0.013300,0.019398&dummy=.png](http://chart.apis.google.com/chart?chs=480x240&cht=lc&chma=30,10,10|0,40&chxt=x,y&chxtc=0,-1000|1,-1000&chxr=0,1,24,1|1,0,0.05,0.01&chdlp=b&chco=3D7930,952826,3D1FC1,FF9900&chls=2|2|2|2&chds=0,0.05,0,0.05,0,0.05,0,0.05&chdl=BC1|BC3-YCoCg|BC3-RGBM|BC3-LUVW&chtt=Kodak%20-%20DXT%20Color&chd=t:0.032624,0.024178,0.018952,0.022459,0.038008,0.028139,0.022829,0.040354,0.020851,0.020663,0.026520,0.018902,0.042782,0.032700,0.023022,0.019964,0.021730,0.031479,0.025946,0.021485,0.028086,0.025337,0.019347,0.033181|0.016332,0.010590,0.009266,0.010276,0.018925,0.013797,0.011330,0.020442,0.010445,0.010226,0.012708,0.009413,0.021023,0.015484,0.010779,0.009729,0.010694,0.015803,0.013372,0.011113,0.013911,0.012687,0.009987,0.015965|0.016881,0.017722,0.011416,0.014217,0.021127,0.014887,0.013463,0.021504,0.011566,0.011493,0.014343,0.011181,0.022516,0.017143,0.014742,0.010352,0.011096,0.017569,0.014062,0.011941,0.014511,0.014100,0.010835,0.017031|0.019391,0.017771,0.013345,0.015694,0.022364,0.018262,0.015737,0.023361,0.014513,0.013768,0.016048,0.015395,0.024690,0.018457,0.016748,0.013119,0.013150,0.018914,0.016672,0.016551,0.017045,0.016356,0.013300,0.019398&dummy=.png)
![http://chart.apis.google.com/chart?chs=480x240&cht=lc&chma=30,10,10|0,40&chxt=x,y&chxtc=0,-1000|1,-1000&chxr=0,1,8,1|1,0,0.05,0.01&chdlp=b&chco=3D7930,952826,3D1FC1,FF9900&chls=2|2|2|2&chds=0,0.05,0,0.05,0,0.05,0,0.05&chdl=BC1|BC3-YCoCg|BC3-RGBM|BC3-LUVW&chtt=Waterloo%20-%20DXT%20Color&chd=t:0.059116,0.048754,0.027649,0.025879,0.025154,0.032835,0.032723,0.029966|0.040873,0.024742,0.018167,0.014057,0.014436,0.015628,0.014838,0.016514|0.046875,0.043097,0.021134,0.015917,0.018908,0.017667,0.019450,0.019344|0.043658,0.044381,0.022368,0.017902,0.019841,0.018990,0.020562,0.019739&dummy=.png](http://chart.apis.google.com/chart?chs=480x240&cht=lc&chma=30,10,10|0,40&chxt=x,y&chxtc=0,-1000|1,-1000&chxr=0,1,8,1|1,0,0.05,0.01&chdlp=b&chco=3D7930,952826,3D1FC1,FF9900&chls=2|2|2|2&chds=0,0.05,0,0.05,0,0.05,0,0.05&chdl=BC1|BC3-YCoCg|BC3-RGBM|BC3-LUVW&chtt=Waterloo%20-%20DXT%20Color&chd=t:0.059116,0.048754,0.027649,0.025879,0.025154,0.032835,0.032723,0.029966|0.040873,0.024742,0.018167,0.014057,0.014436,0.015628,0.014838,0.016514|0.046875,0.043097,0.021134,0.015917,0.018908,0.017667,0.019450,0.019344|0.043658,0.044381,0.022368,0.017902,0.019841,0.018990,0.020562,0.019739&dummy=.png)
![http://chart.apis.google.com/chart?chs=480x240&cht=lc&chma=30,10,10|0,40&chxt=x,y&chxtc=0,-1000|1,-1000&chxr=0,1,6,1|1,0,0.05,0.01&chdlp=b&chco=3D7930,952826,3D1FC1,FF9900&chls=2|2|2|2&chds=0,0.05,0,0.05,0,0.05,0,0.05&chdl=BC1|BC3-YCoCg|BC3-RGBM|BC3-LUVW&chtt=Epic%20-%20DXT%20Color&chd=t:0.053043,0.002376,0.034834,0.048685,0.008337,0.025628|0.027606,0.015367,0.017520,0.025086,0.009263,0.019481|0.029873,0.000000,0.017527,0.026290,0.005817,0.019254|0.029934,0.003893,0.020066,0.028541,0.009276,0.020715&dummy=.png](http://chart.apis.google.com/chart?chs=480x240&cht=lc&chma=30,10,10|0,40&chxt=x,y&chxtc=0,-1000|1,-1000&chxr=0,1,6,1|1,0,0.05,0.01&chdlp=b&chco=3D7930,952826,3D1FC1,FF9900&chls=2|2|2|2&chds=0,0.05,0,0.05,0,0.05,0,0.05&chdl=BC1|BC3-YCoCg|BC3-RGBM|BC3-LUVW&chtt=Epic%20-%20DXT%20Color&chd=t:0.053043,0.002376,0.034834,0.048685,0.008337,0.025628|0.027606,0.015367,0.017520,0.025086,0.009263,0.019481|0.029873,0.000000,0.017527,0.026290,0.005817,0.019254|0.029934,0.003893,0.020066,0.028541,0.009276,0.020715&dummy=.png)
![http://chart.apis.google.com/chart?chs=480x240&cht=lc&chma=30,10,10|0,40&chxt=x,y&chxtc=0,-1000|1,-1000&chxr=0,1,11,1|1,0,0.05,0.01&chdlp=b&chco=3D7930,952826,3D1FC1,FF9900&chls=2|2|2|2&chds=0,0.05,0,0.05,0,0.05,0,0.05&chdl=BC1|BC3-YCoCg|BC3-RGBM|BC3-LUVW&chtt=Farbraush%20-%20DXT%20Color&chd=t:0.017940,0.009320,0.039991,0.028648,0.018436,0.007163,0.008473,0.028858,0.032287,0.009469,0.017410|0.011998,0.004553,0.019009,0.013513,0.008656,0.003173,0.003940,0.014136,0.020108,0.004047,0.011850|0.011968,0.004545,0.018015,0.013149,0.008346,0.001676,0.003171,0.013915,0.021061,0.004852,0.009862|0.014321,0.006457,0.019295,0.014640,0.012143,0.004893,0.007127,0.014303,0.021466,0.013794,0.014989&dummy=.png](http://chart.apis.google.com/chart?chs=480x240&cht=lc&chma=30,10,10|0,40&chxt=x,y&chxtc=0,-1000|1,-1000&chxr=0,1,11,1|1,0,0.05,0.01&chdlp=b&chco=3D7930,952826,3D1FC1,FF9900&chls=2|2|2|2&chds=0,0.05,0,0.05,0,0.05,0,0.05&chdl=BC1|BC3-YCoCg|BC3-RGBM|BC3-LUVW&chtt=Farbraush%20-%20DXT%20Color&chd=t:0.017940,0.009320,0.039991,0.028648,0.018436,0.007163,0.008473,0.028858,0.032287,0.009469,0.017410|0.011998,0.004553,0.019009,0.013513,0.008656,0.003173,0.003940,0.014136,0.020108,0.004047,0.011850|0.011968,0.004545,0.018015,0.013149,0.008346,0.001676,0.003171,0.013915,0.021061,0.004852,0.009862|0.014321,0.006457,0.019295,0.014640,0.012143,0.004893,0.007127,0.014303,0.021466,0.013794,0.014989&dummy=.png)
![http://chart.apis.google.com/chart?chs=480x240&chtt=Witness%20-%20DXT%20Color&cht=lc&chma=30,10,10|0,40&chxt=x,y&chxtc=0,-1000|1,-1000&chxr=0,1,12,1|1,0,0.05,0.01&chdlp=b&chco=3D7930,952826,3D1FC1&chls=2|2|2&chds=0,0.05,0,0.05,0,0.05&chdl=BC1|BC3-YCoCg|BC3-RGBM&chd=t:0.033200,0.013300,0.024000,0.025147,0.024490,0.019622,0.016124,0.013877,0.019269,0.016388,0.012792,0.017029|0.018358,0.009334,0.011481,0.012023,0.011758,0.010076,0.011517,0.007065,0.010439,0.007780,0.005666,0.008560|0.018494,0.008400,0.012027,0.012726,0.012904,0.009872,0.010716,0.008555,0.010776,0.008648,0.005837,0.009183&dummy=.png](http://chart.apis.google.com/chart?chs=480x240&chtt=Witness%20-%20DXT%20Color&cht=lc&chma=30,10,10|0,40&chxt=x,y&chxtc=0,-1000|1,-1000&chxr=0,1,12,1|1,0,0.05,0.01&chdlp=b&chco=3D7930,952826,3D1FC1&chls=2|2|2&chds=0,0.05,0,0.05,0,0.05&chdl=BC1|BC3-YCoCg|BC3-RGBM&chd=t:0.033200,0.013300,0.024000,0.025147,0.024490,0.019622,0.016124,0.013877,0.019269,0.016388,0.012792,0.017029|0.018358,0.009334,0.011481,0.012023,0.011758,0.010076,0.011517,0.007065,0.010439,0.007780,0.005666,0.008560|0.018494,0.008400,0.012027,0.012726,0.012904,0.009872,0.010716,0.008555,0.010776,0.008648,0.005837,0.009183&dummy=.png)
# Normal Compression #
# Lightmap Compression #

@ -0,0 +1,206 @@
The NVIDIA Texture Tools use the following third party libraries:
* [zlib](ThirdPartyLegalNotices#zlib.md)
* [libtiff](ThirdPartyLegalNotices#libtiff.md)
* [libpng](ThirdPartyLegalNotices#libpng.md)
* [libjpeg](ThirdPartyLegalNotices#libjpeg.md)
Note, that the NVTT library does not depend any of these libraries; they are only used by the command line tools.
# zlib #
```
/* zlib.h -- interface of the 'zlib' general purpose compression library
version 1.2.3, July 18th, 2005
Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Jean-loup Gailly Mark Adler
jloup@gzip.org madler@alumni.caltech.edu
The data format used by the zlib library is described by RFCs (Request for
Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt
(zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
*/
```
# libtiff #
```
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission notice appear in
* all copies of the software and related documentation, and (ii) the names of
* Sam Leffler and Silicon Graphics may not be used in any advertising or
* publicity relating to the software without the specific, prior written
* permission of Sam Leffler and Silicon Graphics.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
```
# libpng #
```
/*
* libpng version 1.2.8 - December 3, 2004
* Copyright (c) 1998-2004 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
* libpng versions 1.2.6, August 15, 2004, through 1.2.8, December 3, 2004, are
* Copyright (c) 2004 Glenn Randers-Pehrson, and are
* distributed according to the same disclaimer and license as libpng-1.2.5
* with the following individual added to the list of Contributing Authors:
*
* Cosmin Truta
*
* libpng versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are
* Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
* distributed according to the same disclaimer and license as libpng-1.0.6
* with the following individuals added to the list of Contributing Authors:
*
* Simon-Pierre Cadieux
* Eric S. Raymond
* Gilles Vollant
*
* and with the following additions to the disclaimer:
*
* There is no warranty against interference with your enjoyment of the
* library or against infringement. There is no warranty that our
* efforts or the library will fulfill any of your particular purposes
* or needs. This library is provided with all faults, and the entire
* risk of satisfactory quality, performance, accuracy, and effort is with
* the user.
*
* libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson, and are
* distributed according to the same disclaimer and license as libpng-0.96,
* with the following individuals added to the list of Contributing Authors:
*
* Tom Lane
* Glenn Randers-Pehrson
* Willem van Schaik
*
* libpng versions 0.89, June 1996, through 0.96, May 1997, are
* Copyright (c) 1996, 1997 Andreas Dilger
* Distributed according to the same disclaimer and license as libpng-0.88,
* with the following individuals added to the list of Contributing Authors:
*
* John Bowler
* Kevin Bracey
* Sam Bushell
* Magnus Holmgren
* Greg Roelofs
* Tom Tanner
*
* libpng versions 0.5, May 1995, through 0.88, January 1996, are
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
*
* For the purposes of this copyright and license, "Contributing Authors"
* is defined as the following set of individuals:
*
* Andreas Dilger
* Dave Martindale
* Guy Eric Schalnat
* Paul Schmidt
* Tim Wegner
*
* The PNG Reference Library is supplied "AS IS". The Contributing Authors
* and Group 42, Inc. disclaim all warranties, expressed or implied,
* including, without limitation, the warranties of merchantability and of
* fitness for any purpose. The Contributing Authors and Group 42, Inc.
* assume no liability for direct, indirect, incidental, special, exemplary,
* or consequential damages, which may result from the use of the PNG
* Reference Library, even if advised of the possibility of such damage.
*
* Permission is hereby granted to use, copy, modify, and distribute this
* source code, or portions hereof, for any purpose, without fee, subject
* to the following restrictions:
*
* 1. The origin of this source code must not be misrepresented.
*
* 2. Altered versions must be plainly marked as such and
* must not be misrepresented as being the original source.
*
* 3. This Copyright notice may not be removed or altered from
* any source or altered source distribution.
*
* The Contributing Authors and Group 42, Inc. specifically permit, without
* fee, and encourage the use of this source code as a component to
* supporting the PNG file format in commercial products. If you use this
* source code in a product, acknowledgment is not required but would be
* appreciated.
*/
```
# libjpeg #
```
The authors make NO WARRANTY or representation, either express or implied,
with respect to this software, its quality, accuracy, merchantability, or
fitness for a particular purpose. This software is provided "AS IS", and you,
its user, assume the entire risk as to its quality and accuracy.
This software is copyright (C) 1991-1998, Thomas G. Lane.
All Rights Reserved except as specified below.
Permission is hereby granted to use, copy, modify, and distribute this
software (or portions thereof) for any purpose, without fee, subject to these
conditions:
(1) If any part of the source code for this software is distributed, then this
README file must be included, with this copyright and no-warranty notice
unaltered; and any additions, deletions, or changes to the original files
must be clearly indicated in accompanying documentation.
(2) If only executable code is distributed, then the accompanying
documentation must state that "this software is based in part on the work of
the Independent JPEG Group".
(3) Permission for use of this software is granted only if the user accepts
full responsibility for any undesirable consequences; the authors accept
NO LIABILITY for damages of any kind.
These conditions apply to any software derived from or based on the IJG code,
not just to the unmodified library. If you use our work, you ought to
acknowledge us.
Permission is NOT granted for the use of any IJG author's name or company name
in advertising or publicity relating to this software or products derived from
it. This software may be referred to only as "the Independent JPEG Group's
software".
We specifically permit and encourage the use of this software as the basis of
commercial products, provided that all warranty or liability claims are
assumed by the product vendor.
```

@ -1 +0,0 @@
2.1.2

@ -1,22 +0,0 @@
# Set optimal options for gcc:
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
ENDIF()
IF(MSVC)
# Code generation flags.
# SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /arch:SSE2 /fp:fast")
# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:SSE2 /fp:fast")
# Optimization flags.
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} /O2 /Ob2 /Oi /Ot /Oy /GL")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} /O2 /Ob2 /Oi /Ot /Oy /GL")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG")
SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /LTCG")
SET(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} /LTCG")
# Definitions.
ADD_DEFINITIONS(-D__SSE2__ -D__SSE__ -D__MMX__)
ENDIF(MSVC)

75
configure vendored

@ -1,75 +0,0 @@
#!/usr/bin/env sh
BOLD="\033[1m"
RED="\033[91m"
GREEN="\033[92m"
YELLOW="\033[93m"
CYAN="\033[96m"
NORMAL="\033[0m"
# Make sure cmake is available.
if command -v cmake >/dev/null 2>&1;
then
CMAKE=cmake
else
echo "Error - cmake is not available!"
exit 2
fi
help=false
build="debug" # release
prefix=/usr/local
# Parse the args
for i in "$@"
do
case $i in
--help ) help=true ;;
--debug ) build="debug" ;;
--release ) build="release" ;;
--prefix=* ) prefix="${i#--prefix=}" ;;
* ) echo "Unrecognised argument $i" ;;
esac
done
if [ "$help" = "true" ]
then
echo "-----------------------------------------------"
echo "nvidia-texture-tools "`cat VERSION`" configuration script"
echo "-----------------------------------------------"
echo
echo "--help Show this message."
echo "--debug Configure debug build."
echo "--release Configure release build."
echo "--prefix=path Installation prefix."
echo "--include=path Include path."
echo "--lib=path Library path."
exit 0
fi
echo "-- Configuring nvidia-texture-tools "`cat VERSION`
mkdir -p ./build-$build
cd ./build-$build
$CMAKE .. -DNVTT_SHARED=0 -DCMAKE_BUILD_TYPE=$build -DCMAKE_INSTALL_PREFIX=$prefix -G "Unix Makefiles" || exit 1
cd ..
echo ""
echo -e "Your configure completed "$GREEN"successfully"$NORMAL", now type "$BOLD"make"$NORMAL
echo ""
cat > Makefile << EOF
all:
@+make --no-print-directory -C build-$build/
install:
@+make install --no-print-directory -C build-$build/
package:
@+make package --no-print-directory -C build-$build/
test:
@+make test --no-print-directory -C build-$build/
clean:
@+make clean --no-print-directory -C build-$build/
distclean:
@rm -Rf build-$build/
EOF

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 KiB

@ -1,95 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
typedef unsigned char uint8;
static int Mul8Bit(int a, int b)
{
int t = a * b + 128;
return (t + (t >> 8)) >> 8;
}
// this exactly matches the (fm*2 + to)/3
static inline int Lerp13_16bit(int fm, int to)
{
int t = fm * (2 * 0xAAAB) + to * 0xAAAB;
return t >> 17;
}
static inline int Lerp13(int fm, int to)
{
return (fm * 2 + to) / 3;
}
static void PrepareOptTable(uint8 * Table, const uint8 * expand, int size)
{
for (int i = 0; i < 256; i++)
{
float bestErr = 256;
for (int min = 0; min < size; min++)
{
for (int max = 0; max < size; max++)
{
int mine = expand[min];
int maxe = expand[max];
//if (maxe - mine < 32)
{
//printf("%d <-> %d\n", maxe + Mul8Bit(mine-maxe, 0x55), Lerp13(maxe, mine));
//int err = abs(Lerp13_16bit(mine, maxe) - i);
//int err = abs(maxe + Mul8Bit(mine-maxe, 0x55) - i);
float err = abs(Lerp13(maxe, mine) - i);
//err += 0.03f * abs(maxe - mine);
err += 0.03f * abs(max - min);
if (err < bestErr)
{
Table[i*2+0] = max;
Table[i*2+1] = min;
bestErr = err;
}
}
}
}
printf("%d: %f %d\n", i, bestErr, abs(Table[i*2+0] - Table[i*2+1]));
}
}
int main()
{
uint8 OMatch5[256*2];
uint8 OMatch6[256*2];
uint8 Expand5[32];
uint8 Expand6[64];
for (int i=0; i<32; i++)
Expand5[i] = (i<<3)|(i>>2);
for (int i=0; i<64; i++)
Expand6[i] = (i<<2)|(i>>4);
PrepareOptTable(OMatch5, Expand5, 32);
PrepareOptTable(OMatch6, Expand6, 64);
printf("const static uint8 OMatch5[256][2] = {\n");
for (int i = 0; i < 256; i++)
{
printf("\t{0x%.2X, 0x%.2X},\n", OMatch5[2*i+0], OMatch5[2*i+1]);
}
printf("}\n");
printf("const static uint8 OMatch6[256][2] = {\n");
for (int i = 0; i < 256; i++)
{
printf("\t{0x%.2X, 0x%.2X},\n", OMatch6[2*i+0], OMatch6[2*i+1]);
}
printf("}\n");
return 0;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 654 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 309 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 828 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 541 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 492 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 375 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 444 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 415 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 621 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 407 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 574 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 719 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 604 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 491 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 622 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 767 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 604 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 553 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 770 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 569 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 606 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 519 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 803 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 676 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 598 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 522 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 588 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 763 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 656 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save