# IHVImageFormatImporter

> Use IHVImageFormatImporter to modify Texture2D import settings for Textures in IHV (Independent Hardware Vendor) formats from Editor scripts. These formats allow you to import raw texture data and bypass Unity's texture importer, allowing pixel data which might be compressed by an external tool to be converted to a Texture. IHVImageFormatImporter supports the following file formats: <a href=" https://docs.imgtec.com/specifications/pvr-file-format-specification/html/topics/pvr-introduction.html>.pvr <a href=" https://github.com/ARM-software/astc-encoder/blob/main/Docs/FileFormat.md>.astc <a href=" https://registry.khronos.org/KTX/specs/1.0/ktxspec.v1.html>.ktx <a href=" https://learn.microsoft.com/en-us/windows/win32/direct3ddds/dx-graphics-dds-pguide>.dds

## Definition

* **Type:** Class
* **Namespace:** [UnityEditor](/engine/6000.7/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule
* **Inherits from:** [AssetImporter](/engine/6000.7/script-reference/unityeditor/assetimporter.md)

```csharp
public sealed class IHVImageFormatImporter : AssetImporter
```

## Remarks

**File Format Support Notes:**

Unity's support for these formats is limited to features that provide essential functionality, with a focus on importing raw compressed texture and pixel data into Unity.  Some of the advanced information and metadata stored in these formats may be ignored by Unity. If you encounter import problems, it can be useful to use a different export tool, because the formats are usually output by third-party export tools which interpret the data in different ways.

Some limitations of Unity's graphics stack also apply to all these formats:

* **Block size**: The dimensions of compressed texture formats must be a multiple of the block size. Unity does not support padding to the nearest multiple in blocks.
* **sRGB RG formats**: Unity emulates some formats such as 2 channel RG textures with the sRGB transfer function on each channel, by internally falling back to a RGBA format. The unused channels might contain a value of 0xFF instead of 0x00, leading to unexpected coloring when displayed as RGB on screen. To avoid any issues,  only use the rg channels in the shaders for sRGB RG formats.
* **Luma format**: Single channel Luma may be emulated using an equally sized format like R8. As a result, the shader sampled values may be of the format float4(X,0,0,1) instead of float4(X,X,X,1).
* **sRGB settings**: Unity ignores sRGB settings in the imported files. Use the IHVImageFormatImporter I Inspector to set whether a file is sRGB or not.

The following is a list of format specific limitations. Familiarity with each format is required to understand these limitations.

**PVR**

Supports format version 2 and 3.

Supports Texture2D (with optional mipmaps) only, no volume array or cubemaps.

Color space, alpha premultiplication and channel type are ignored and set to Unity's defaults.

Supported formats for v2: The PVR v2 format enum and the mapped Unity format.

* MGLPT\_PVRTC2,OGL\_PVRTC2: if alpha TextureFormat.PVRTC\_RGBA2 else  TextureFormat.PVRTC\_RGB2
* MGLPT\_PVRTC4,OGL\_PVRTC4: if alpha TextureFormat.PVRTC\_RGBA4 else TextureFormat.PVRTC\_RGB4
* MGLPT\_RGB\_888,OGL\_RGB\_888: TextureFormat.RGB24
* MGLPT\_RGB\_565,OGL\_RGB\_565: TextureFormat.RGB565
* D3D\_DXT1: TextureFormat.DXT1
* D3D\_DXT5: TextureFormat.DXT5
* ETC\_RGB\_4BPP: TextureFormat.ETC\_RGB4
* OGL\_RGBA\_8888: TextureFormat.RGBA32
* MGLPT\_ARGB\_4444: TextureFormat.ARGB4444
* OGL\_RGBA\_4444: TextureFormat.RGBA4444

Supported formats for v3: The PVR v3 format ID and the mapped Unity format.

* Id 0: TextureFormat.PVRTC\_RGB2
* Id 1: TextureFormat.PVRTC\_RGBA2
* Id 2: TextureFormat.PVRTC\_RGB4
* Id 3: TextureFormat.PVRTC\_RGBA4
* Id 6: TextureFormat.ETC\_RGB4
* Id 7: TextureFormat.DXT1
* Id 11: TextureFormat.DXT5
* Id 22: TextureFormat.ETC2\_RGB
* Id 23: TextureFormat.ETC2\_RGBA8
* Id 24: TextureFormat.ETC2\_RGBA1
* Id 25: TextureFormat.EAC\_R
* Id 26: TextureFormat.EAC\_RG
* Id 27: TextureFormat.ASTC\_4x4
* Id 29: TextureFormat.ASTC\_5x5
* Id 31: TextureFormat.ASTC\_6x6
* Id 34: TextureFormat.ASTC\_8x8
* Id 38: TextureFormat.ASTC\_10x10
* Id 40: TextureFormat.ASTC\_12x12

The following formats specified in the PVR file through a channel order and bitwidth are also supported:

* TextureFormat.BGRA32
* TextureFormat.RGBA32
* TextureFormat.RGBA4444
* TextureFormat.RGB565
* TextureFormat.RGB24
* TextureFormat.Alpha8

**ASTC**

Supports Texture2D (with no mipmaps) only, no volume support.

Supports only 4x4 5x5 6x6 8x8 10x10 12x12 astc block sizes.

**KTX**

Supports Texture2D (with optional mipmaps) only, no volume array or cubemaps.

Only the older KTX v1 format is supported.

sRGB settings of the texture formats are ignored.

Supported formats:

* GL\_RGBA8 : TextureFormat.RGBA32
* GL\_RGB8 : TextureFormat.RGB24
* GL\_RGBA4 : TextureFormat.ARGB4444
* GL\_RGB565 : TextureFormat.RGB565
* GL\_COMPRESSED\_RGB\_S3TC\_DXT1\_EXT : TextureFormat.DXT1
* GL\_COMPRESSED\_SRGB\_S3TC\_DXT1\_NV : TextureFormat.DXT1
* GL\_COMPRESSED\_RGBA\_S3TC\_DXT5\_EXT : TextureFormat.DXT5
* GL\_COMPRESSED\_SRGB\_ALPHA\_S3TC\_DXT5\_NV : TextureFormat.DXT5
* GL\_COMPRESSED\_RED\_RGTC1 : TextureFormat.BC4
* GL\_COMPRESSED\_RG\_RGTC2 : TextureFormat.BC5
* GL\_COMPRESSED\_RGBA\_BPTC\_UNORM\_ARB : TextureFormat.BC7
* GL\_COMPRESSED\_SRGB\_ALPHA\_BPTC\_UNORM\_ARB : TextureFormat.BC7
* GL\_COMPRESSED\_RGB\_PVRTC\_2BPPV1\_IMG : TextureFormat.PVRTC\_RGB2
* GL\_COMPRESSED\_RGBA\_PVRTC\_2BPPV1\_IMG : TextureFormat.PVRTC\_RGBA2
* GL\_COMPRESSED\_RGB\_PVRTC\_4BPPV1\_IMG : TextureFormat.PVRTC\_RGB4
* GL\_COMPRESSED\_RGBA\_PVRTC\_4BPPV1\_IMG : TextureFormat.PVRTC\_RGBA4
* GL\_ETC1\_RGB8\_OES : TextureFormat.ETC\_RGB4
* GL\_COMPRESSED\_R11\_EAC : TextureFormat.EAC\_R
* GL\_COMPRESSED\_SIGNED\_R11\_EAC : TextureFormat.EAC\_R\_SIGNED
* GL\_COMPRESSED\_RG11\_EAC : TextureFormat.EAC\_RG
* GL\_COMPRESSED\_SIGNED\_RG11\_EAC : TextureFormat.EAC\_RG\_SIGNED
* GL\_COMPRESSED\_RGB8\_ETC2 : TextureFormat.ETC2\_RGB
* GL\_COMPRESSED\_RGB8\_PUNCHTHROUGH\_ALPHA1\_ETC2 : TextureFormat.ETC2\_RGBA1
* GL\_COMPRESSED\_RGBA8\_ETC2\_EAC : TextureFormat.ETC2\_RGBA8
* GL\_COMPRESSED\_RGBA\_ASTC\_4x4\_KHR : TextureFormat.ASTC\_4x4
* GL\_COMPRESSED\_RGBA\_ASTC\_5x5\_KHR : TextureFormat.ASTC\_5x5
* GL\_COMPRESSED\_RGBA\_ASTC\_6x6\_KHR : TextureFormat.ASTC\_6x6
* GL\_COMPRESSED\_RGBA\_ASTC\_8x8\_KHR : TextureFormat.ASTC\_8x8
* GL\_COMPRESSED\_RGBA\_ASTC\_10x10\_KHR : TextureFormat.ASTC\_10x10
* GL\_COMPRESSED\_RGBA\_ASTC\_12x12\_KHR : TextureFormat.ASTC\_12x12

**DDS**

Supports Texture2D and CubeMap (with optional mipmaps) only, no volume, array or cubemap arrays.

BC7 data cannot be flipped on import. Because of its compression format, Unity imports it upside down.

Supported formats:

DX10 Style formats:

* DXGI\_FORMAT\_BC1\_UNORM : TextureFormat.DXT1
* DXGI\_FORMAT\_BC1\_UNORM\_SRGB : TextureFormat.DXT1
* DXGI\_FORMAT\_BC2\_UNORM : TextureFormat.DXT3
* DXGI\_FORMAT\_BC2\_UNORM\_SRGB : TextureFormat.DXT3
* DXGI\_FORMAT\_BC3\_UNORM : TextureFormat.DXT5
* DXGI\_FORMAT\_BC3\_UNORM\_SRGB : TextureFormat.DXT5
* DXGI\_FORMAT\_BC4\_UNORM : TextureFormat.BC4
* DXGI\_FORMAT\_BC5\_UNORM : TextureFormat.BC5
* DXGI\_FORMAT\_BC6H\_UF16 : TextureFormat.BC6H
* DXGI\_FORMAT\_BC7\_UNORM : TextureFormat.BC7
* DXGI\_FORMAT\_BC7\_UNORM\_SRGB : TextureFormat.BC7
* DXGI\_FORMAT\_R16\_FLOAT : TextureFormat.RHalf
* DXGI\_FORMAT\_R16G16\_FLOAT : TextureFormat.RGHalf
* DXGI\_FORMAT\_R16G16B16A16\_FLOAT : TextureFormat.RGBAHalf
* DXGI\_FORMAT\_R32\_FLOAT : TextureFormat.RFloat
* DXGI\_FORMAT\_R32G32\_FLOAT : TextureFormat.RGFloat
* DXGI\_FORMAT\_R32G32B32A32\_FLOAT : TextureFormat.RGBAFloat
* DXGI\_FORMAT\_R11G11B10\_FLOAT : TextureFormat.RGBAHalf, desc->sourceFormat = 26
* DXGI\_FORMAT\_R8G8B8A8\_UNORM : TextureFormat.RGBA32
* DXGI\_FORMAT\_R8G8B8A8\_UNORM\_SRGB : TextureFormat.RGBA32
* DXGI\_FORMAT\_R8\_UNORM : TextureFormat.R8
* DXGI\_FORMAT\_R8G8\_UNORM : TextureFormat.RG16
* DXGI\_FORMAT\_B4G4R4A4\_UNORM : TextureFormat.ARGB4444
* DXGI\_FORMAT\_B5G6R5\_UNORM : TextureFormat.RGB565
* DXGI\_FORMAT\_R16\_SNORM : TextureFormat.R16\_SIGNED
* DXGI\_FORMAT\_R16G16\_SNORM : TextureFormat.RG32\_SIGNED
* DXGI\_FORMAT\_R16G16B16A16\_SNORM : TextureFormat.RGBA64\_SIGNED
* DXGI\_FORMAT\_R8G8B8A8\_SNORM : TextureFormat.RGBA32\_SIGNED
* DXGI\_FORMAT\_R8G8\_SNORM : TextureFormat.RG16\_SIGNED
* DXGI\_FORMAT\_R8\_SNORM : TextureFormat.R8\_SIGNED

FOURCC & DX9 Style formats:

* D3DFMT\_R16F: TextureFormat.RHalf
* D3DFMT\_G16R16F: TextureFormat.RGHalf
* D3DFMT\_A16B16G16R16F: TextureFormat.RGBAHalf
* D3DFMT\_R32F: TextureFormat.RFloat
* D3DFMT\_G32R32F: TextureFormat.RGFloat
* D3DFMT\_A32B32G32R32F: TextureFormat.RGBAFloat
* ‘DXT1’: TextureFormat.DXT1
* ‘DXT3’: TextureFormat.DXT3
* ‘DXT5’: TextureFormat.DXT5
* ‘ATI1N’: TextureFormat.BC4
* ‘ATI2N’: TextureFormat.BC5
* ‘A2XY’: TextureFormat.BC5

Bit packed RGB formats (bitcount + mask):

* TextureFormat.BGR24
* TextureFormat.ARGB32
* TextureFormat.RGBA32
* TextureFormat.ARGB4444
* TextureFormat.RGB565

Luminance Alpha Formats:

* TextureFormat.R8 (luminance)
* TextureFormat.Alpha8.

## Properties

| Property                                                                                                                   | Description                                                                                                   |
| -------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| [filterMode](/engine/6000.7/script-reference/unityeditor/ihvimageformatimporter/filtermode.md)                             | Filtering mode of the texture.                                                                                |
| [ignoreMipmapLimit](/engine/6000.7/script-reference/unityeditor/ihvimageformatimporter/ignoremipmaplimit.md)               | Enable if the texture should ignore any texture mipmap limit settings set in the Project Settings.            |
| [isReadable](/engine/6000.7/script-reference/unityeditor/ihvimageformatimporter/isreadable.md)                             | Is texture data readable from scripts.                                                                        |
| [mipmapLimitGroupName](/engine/6000.7/script-reference/unityeditor/ihvimageformatimporter/mipmaplimitgroupname.md)         | Name of the texture mipmap limit group to which this texture belongs.                                         |
| [streamingMipmaps](/engine/6000.7/script-reference/unityeditor/ihvimageformatimporter/streamingmipmaps.md)                 | Enable mipmap streaming for this texture.                                                                     |
| [streamingMipmapsPriority](/engine/6000.7/script-reference/unityeditor/ihvimageformatimporter/streamingmipmapspriority.md) | Relative priority for this texture when reducing memory size in order to hit the memory budget.               |
| [wrapMode](/engine/6000.7/script-reference/unityeditor/ihvimageformatimporter/wrapmode.md)                                 | Texture coordinate wrapping mode.                                                                             |
| [wrapModeU](/engine/6000.7/script-reference/unityeditor/ihvimageformatimporter/wrapmodeu.md)                               | Texture U coordinate wrapping mode.                                                                           |
| [wrapModeV](/engine/6000.7/script-reference/unityeditor/ihvimageformatimporter/wrapmodev.md)                               | Texture V coordinate wrapping mode.                                                                           |
| [wrapModeW](/engine/6000.7/script-reference/unityeditor/ihvimageformatimporter/wrapmodew.md)                               | Texture W coordinate wrapping mode for [Texture3D](/engine/6000.7/script-reference/unityengine/texture3d.md). |

## Inheritance

**Inherited Members:**

* [AssetImporter.GetImportLog(string)](/engine/6000.7/script-reference/unityeditor/assetimporter/getimportlog.md)
* [AssetImporter.SetAssetBundleNameAndVariant(string, string)](/engine/6000.7/script-reference/unityeditor/assetimporter/setassetbundlenameandvariant.md)
* [AssetImporter.GetAtPath(string)](/engine/6000.7/script-reference/unityeditor/assetimporter/getatpath.md)
* [AssetImporter.SaveAndReimport()](/engine/6000.7/script-reference/unityeditor/assetimporter/saveandreimport.md)
* [AssetImporter.AddRemap(SourceAssetIdentifier, Object)](/engine/6000.7/script-reference/unityeditor/assetimporter/addremap.md)
* [AssetImporter.RemoveRemap(SourceAssetIdentifier)](/engine/6000.7/script-reference/unityeditor/assetimporter/removeremap.md)
* [AssetImporter.GetExternalObjectMap()](/engine/6000.7/script-reference/unityeditor/assetimporter/getexternalobjectmap.md)
* [AssetImporter.SupportsRemappedAssetType(Type)](/engine/6000.7/script-reference/unityeditor/assetimporter/supportsremappedassettype.md)
* [AssetImporter.assetPath](/engine/6000.7/script-reference/unityeditor/assetimporter/assetpath.md)
* [AssetImporter.importSettingsMissing](/engine/6000.7/script-reference/unityeditor/assetimporter/importsettingsmissing.md)
* [AssetImporter.userData](/engine/6000.7/script-reference/unityeditor/assetimporter/userdata.md)
* [AssetImporter.assetBundleName](/engine/6000.7/script-reference/unityeditor/assetimporter/assetbundlename.md)
* [AssetImporter.assetBundleVariant](/engine/6000.7/script-reference/unityeditor/assetimporter/assetbundlevariant.md)
* [Object.GetEntityId()](/engine/6000.7/script-reference/unityengine/object/getentityid.md)
* [Object.GetHashCode()](/engine/6000.7/script-reference/unityengine/object/gethashcode.md)
* [Object.InstantiateAsync\<T>(T)](/engine/6000.7/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, Transform)](/engine/6000.7/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, Vector3, Quaternion)](/engine/6000.7/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, Transform, Vector3, Quaternion)](/engine/6000.7/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int)](/engine/6000.7/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform)](/engine/6000.7/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Vector3, Quaternion)](/engine/6000.7/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>)](/engine/6000.7/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform, Vector3, Quaternion)](/engine/6000.7/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform, Vector3, Quaternion, CancellationToken)](/engine/6000.7/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>)](/engine/6000.7/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>, CancellationToken)](/engine/6000.7/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, InstantiateParameters, CancellationToken)](/engine/6000.7/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, InstantiateParameters, CancellationToken)](/engine/6000.7/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, Vector3, Quaternion, InstantiateParameters, CancellationToken)](/engine/6000.7/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Vector3, Quaternion, InstantiateParameters, CancellationToken)](/engine/6000.7/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>, InstantiateParameters, CancellationToken)](/engine/6000.7/script-reference/unityengine/object/instantiateasync.md)
* [Object.Instantiate(Object, Vector3, Quaternion)](/engine/6000.7/script-reference/unityengine/object/instantiate.md#instantiate\(object-vector3-quaternion\))
* [Object.Instantiate(Object, Vector3, Quaternion, Transform)](/engine/6000.7/script-reference/unityengine/object/instantiate.md#instantiate\(object-vector3-quaternion-transform\))
* [Object.Instantiate(Object)](/engine/6000.7/script-reference/unityengine/object/instantiate.md#instantiate\(object\))
* [Object.Instantiate(Object, Scene)](/engine/6000.7/script-reference/unityengine/object/instantiate.md#instantiate\(object-scene\))
* [Object.Instantiate\<T>(T, InstantiateParameters)](/engine/6000.7/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Vector3, Quaternion, InstantiateParameters)](/engine/6000.7/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate(Object, Transform)](/engine/6000.7/script-reference/unityengine/object/instantiate.md#instantiate\(object-transform\))
* [Object.Instantiate(Object, Transform, bool)](/engine/6000.7/script-reference/unityengine/object/instantiate.md#instantiate\(object-transform-bool\))
* [Object.Instantiate\<T>(T)](/engine/6000.7/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Vector3, Quaternion)](/engine/6000.7/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Vector3, Quaternion, Transform)](/engine/6000.7/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Transform)](/engine/6000.7/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Transform, bool)](/engine/6000.7/script-reference/unityengine/object/instantiate.md)
* [Object.Destroy(Object, float)](/engine/6000.7/script-reference/unityengine/object/destroy.md)
* [Object.DestroyImmediate(Object, bool)](/engine/6000.7/script-reference/unityengine/object/destroyimmediate.md)
* [Object.FindObjectsByType(Type)](/engine/6000.7/script-reference/unityengine/object/findobjectsbytype.md#findobjectsbytype\(type\))
* [Object.FindObjectsByType(Type, FindObjectsInactive)](/engine/6000.7/script-reference/unityengine/object/findobjectsbytype.md#findobjectsbytype\(type-findobjectsinactive\))
* [Object.DontDestroyOnLoad(Object)](/engine/6000.7/script-reference/unityengine/object/dontdestroyonload.md)
* [Object.FindAnyObjectByType\<T>()](/engine/6000.7/script-reference/unityengine/object/findanyobjectbytype.md#findanyobjectbytypet\(\))
* [Object.FindAnyObjectByType\<T>(FindObjectsInactive)](/engine/6000.7/script-reference/unityengine/object/findanyobjectbytype.md#findanyobjectbytypet\(findobjectsinactive\))
* [Object.FindObjectsByType\<T>()](/engine/6000.7/script-reference/unityengine/object/findobjectsbytype.md#findobjectsbytypet\(\))
* [Object.FindObjectsByType\<T>(FindObjectsInactive)](/engine/6000.7/script-reference/unityengine/object/findobjectsbytype.md#findobjectsbytypet\(findobjectsinactive\))
* [Object.FindAnyObjectByType(Type)](/engine/6000.7/script-reference/unityengine/object/findanyobjectbytype.md#findanyobjectbytype\(type\))
* [Object.FindAnyObjectByType(Type, FindObjectsInactive)](/engine/6000.7/script-reference/unityengine/object/findanyobjectbytype.md#findanyobjectbytype\(type-findobjectsinactive\))
* [Object.ToString()](/engine/6000.7/script-reference/unityengine/object/tostring.md)
* [Object.name](/engine/6000.7/script-reference/unityengine/object/name.md)
* [Object.hideFlags](/engine/6000.7/script-reference/unityengine/object/hideflags.md)

### Operators

| Operator                                                                           | Description                                                             |
| ---------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| [operator ==](/engine/6000.7/script-reference/unityengine/object/op-equality.md)   | Compares two object references to see if they refer to the same object. |
| [bool](/engine/6000.7/script-reference/unityengine/object/op-implicit.md)          | Determines whether the object exists.                                   |
| [operator !=](/engine/6000.7/script-reference/unityengine/object/op-inequality.md) | Compares if two objects refer to a different object.                    |
