---
title: "TiffEncoderOptions Class"
canonical: https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_TiffEncoderOptions.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# TiffEncoderOptions Class
 
This class holds TIFF encoder options.
 
**Namespace:** [Aurigma.GraphicsMill.Codecs](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Codecs.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```
Public NotInheritable Class TiffEncoderOptions _Inherits EncoderOptions
```
 
```csharp
public sealed class TiffEncoderOptions : EncoderOptions
```
 
## Remarks
 The main TIFF encoder setting is a compression type. To change compression type use [Compression](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_TiffEncoderOptions_Compression.htm.md) property. This property accepts members of the [CompressionType](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_CompressionType.htm.md) enumeration. 
Another setting which can be specified is alpha premultiplication. This option has meaning only when saving image with alpha channel. You can turn it on or off using [AlphaPremultiplied](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_TiffEncoderOptions_AlphaPremultiplied.htm.md) property. The default value of this property is **false** and content of the alpha channel is simply stored along with color channels of the image by default. The second way is to store image with "associated" alpha channel. This way implies that not only alpha channel itself will be encoded into the file, but also color channels of each pixel will be premultiplied with the corresponding alpha channel value.

You should use TIFF files with associated alpha if you have software which gain some benefit from them. For example, TIFF files with premultiplied alpha are correctly shown as partially transparent images in Adobe® Photoshop®, while images with unassociated alpha are shown as non transparent images with additional channel. But you should take into account that premultiplication process slows down encoding and introduces rounding error. So you should not set this property to **true** without reason.

Also you can provide meta-information for encoding. Use [AdobeResources](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_TiffEncoderOptions_AdobeResources.htm.md), [Exif](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_TiffEncoderOptions_Exif.htm.md) and [Iptc](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_TiffEncoderOptions_Iptc.htm.md) properties to specify corresponding metadata objects.

[MediaFormat](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_EncoderOptions_MediaFormat.htm.md) property of this class always returns value that equals to [TiffFormat](https://www.graphicsmill.com/docs/gm5/F_Aurigma_GraphicsMill_Codecs_FormatManager_TiffFormat.htm.md) static field of the [FormatManager](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_FormatManager.htm.md) class. [Left](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_EncoderOptions_Left.htm.md) and [Top](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_EncoderOptions_Top.htm.md) are meaningless for TIFF and always set to 0.
 
## Examples
  
This code sample demonstrates how to save the TIFF with the single frame. It just converts the JPEG file into the TIFF format.
 
```
Dim bitmap As New Aurigma.GraphicsMill.Bitmap("c:\Mountain.jpg")

bitmap.Save("C:\Mountain.tif", _
    New Aurigma.GraphicsMill.Codecs.TiffEncoderOptions(50))

bitmap.Dispose()
```
 
```csharp
using (Aurigma.GraphicsMill.Bitmap bitmap =
    new Aurigma.GraphicsMill.Bitmap(@"c:\Mountain.jpg"))
{
    bitmap.Save(@"C:\Mountain.tif", 
        new Aurigma.GraphicsMill.Codecs.TiffEncoderOptions(50));
}
```
 
TIFF files can store EXIF and IPTC data blocks. Graphics Mill for .NET allows you extracting this data from the TIFF file and save it into another TIFF file (as well as into the other file format which supports EXIF and IPTC). This code sample demonstrates how to add the EXIF and IPTC data to the file:
 
```
Dim bitmap As New Aurigma.GraphicsMill.Bitmap("c:\Mountain.jpg")
Dim encoderOptions As New Aurigma.GraphicsMill.Codecs.TiffEncoderOptions(50)

'EXIF
Dim exif As New Aurigma.GraphicsMill.Codecs.ExifDictionary
exif(Aurigma.GraphicsMill.Codecs.ExifDictionary.Software) = "Aurigma Graphics Mill"

encoderOptions.Exif = exif

'IPTC
Dim iptc As New Aurigma.GraphicsMill.Codecs.IptcDictionary
iptc(Aurigma.GraphicsMill.Codecs.IptcDictionary.Category) = "Nature"
iptc(Aurigma.GraphicsMill.Codecs.IptcDictionary.CopyrightNotice) = "Aurigma Inc."
iptc(Aurigma.GraphicsMill.Codecs.IptcDictionary.Keyword) = "mountain"

encoderOptions.Iptc = iptc

'Adobe resource blocks
Dim adobeResources As New Aurigma.GraphicsMill.Codecs.AdobeResourceDictionary
'Create new adobe image resource block with the required metadata
Dim arBlock As New Aurigma.GraphicsMill.Codecs.AdobeResourceBlock("Copyright", New Byte() {1})
'Set this block to the item with 0x040A ID (copyright flag)
adobeResources.Item(&H40A) = arBlock

encoderOptions.AdobeResources = adobeResources

'XMP
Dim xmp As New Aurigma.GraphicsMill.Codecs.XmpData()
'Create a node with the required metadata
Dim node As New Aurigma.GraphicsMill.Codecs.XmpValueNode( _
    Aurigma.GraphicsMill.Codecs.XmpNodeType.SimpleProperty, _
    "John Doe", _
    Aurigma.GraphicsMill.Codecs.XmpTagNames.DCCreator)
xmp.AddNode(node)

encoderOptions.Xmp = xmp.Save()

bitmap.Save("C:\Mountain.tif", encoderOptions)

bitmap.Dispose()
```
 
```csharp
using (Aurigma.GraphicsMill.Bitmap bitmap = 
           new Aurigma.GraphicsMill.Bitmap(@"c:\Mountain.jpg"))
{                
    Aurigma.GraphicsMill.Codecs.TiffEncoderOptions encoderOptions =
        new Aurigma.GraphicsMill.Codecs.TiffEncoderOptions(50);

    //EXIF
    Aurigma.GraphicsMill.Codecs.ExifDictionary exif =
        new Aurigma.GraphicsMill.Codecs.ExifDictionary();
    exif[Aurigma.GraphicsMill.Codecs.ExifDictionary.Software] = "Aurigma Graphics Mill";

    encoderOptions.Exif = exif;
    
    //IPTC
    Aurigma.GraphicsMill.Codecs.IptcDictionary iptc =
        new Aurigma.GraphicsMill.Codecs.IptcDictionary();
    iptc[Aurigma.GraphicsMill.Codecs.IptcDictionary.Category] = "Nature";
    iptc[Aurigma.GraphicsMill.Codecs.IptcDictionary.CopyrightNotice] = "Aurigma Inc.";
    iptc[Aurigma.GraphicsMill.Codecs.IptcDictionary.Keyword] = "mountain";

    encoderOptions.Iptc = iptc;

    //Adobe resource blocks
    Aurigma.GraphicsMill.Codecs.AdobeResourceDictionary adobeResources =
        new Aurigma.GraphicsMill.Codecs.AdobeResourceDictionary();
    //Create new adobe image resource block with the required metadata
    Aurigma.GraphicsMill.Codecs.AdobeResourceBlock arBlock = new
        Aurigma.GraphicsMill.Codecs.AdobeResourceBlock("Copyright", new byte[] { 1 });
    //Set this block to the item with 0x040A ID (copyright flag)
    adobeResources[0x040A] = arBlock;

    encoderOptions.AdobeResources = adobeResources;

    //XMP
    Aurigma.GraphicsMill.Codecs.XmpData xmp = new Aurigma.GraphicsMill.Codecs.XmpData();
    //Create a node with the required metadata
    Aurigma.GraphicsMill.Codecs.XmpValueNode node = new
        Aurigma.GraphicsMill.Codecs.XmpValueNode(
            Aurigma.GraphicsMill.Codecs.XmpNodeType.SimpleProperty,
            "John Doe",
            Aurigma.GraphicsMill.Codecs.XmpTagNames.DCCreator);
    xmp.AddNode(node);

    encoderOptions.Xmp = xmp.Save();

    bitmap.Save(@"C:\Mountain.tif", encoderOptions);
}
```
 
## Inheritance Hierarchy
  
- [System.Object](http://msdn2.microsoft.com/en-us/e5kfa45b)
    - [Aurigma.GraphicsMill.Codecs.EncoderOptions](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_EncoderOptions.htm.md)
        - Aurigma.GraphicsMill.Codecs.TiffEncoderOptions
 
## Thread Safety
 Static members of this type are safe for multi-threaded operations. Instance members of this type are not safe for multi-threaded operations.
 
## Object Model

[![](https://www.graphicsmill.com/docs/gm5/Aurigma.GraphicsMill_ObjectModel_182.png)](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_TiffEncoderOptions.htm.md)
![](https://www.graphicsmill.com/docs/gm5/ObjectModel2.png)[![](https://www.graphicsmill.com/docs/gm5/Aurigma.GraphicsMill_ObjectModel_4.png)](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_AdobeResourceDictionary.htm.md)
![](https://www.graphicsmill.com/docs/gm5/ObjectModel2.png)[![](https://www.graphicsmill.com/docs/gm5/Aurigma.GraphicsMill_ObjectModel_5.png)](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_ExifDictionary.htm.md)
![](https://www.graphicsmill.com/docs/gm5/ObjectModel2.png)[![](https://www.graphicsmill.com/docs/gm5/Aurigma.GraphicsMill_ObjectModel_6.png)](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_IptcDictionary.htm.md)
![](https://www.graphicsmill.com/docs/gm5/ObjectModel2.png)[![](https://www.graphicsmill.com/docs/gm5/Aurigma.GraphicsMill_ObjectModel_186.png)](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_TiffExtraChannelCollection.htm.md)
![](https://www.graphicsmill.com/docs/gm5/ObjectModel1.png)[![](https://www.graphicsmill.com/docs/gm5/Aurigma.GraphicsMill_ObjectModel_19.png)](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_Frame.htm.md)
  
## See Also

### Reference

- [TiffEncoderOptions Members](https://www.graphicsmill.com/docs/gm5/AllMembers_T_Aurigma_GraphicsMill_Codecs_TiffEncoderOptions.htm.md)
- [Aurigma.GraphicsMill.Codecs Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Codecs.htm.md)
