Click or drag to resize

TiffEncoder Class

An ImageEncoder that will write Tagged Image File Format (TIFF) images to a Stream.

Inheritance Hierarchy

Namespace:  Atalasoft.Imaging.Codec
Assembly:  Atalasoft.dotImage (in Atalasoft.dotImage.dll) Version: 11.0.0.0.0.297 (.NET 4.5.2, x86)
Syntax
public class TiffEncoder : MultiFramedImageEncoder, 
	IAppendable, IAnnotationEncoder

The TiffEncoder type exposes the following members.

Constructors
  NameDescription
Public methodTiffEncoder
Initializes a new instance of a TiffEncoder.
Public methodTiffEncoder(TiffCompression)
Initializes a new instance of a TiffEncoder specifying the compression.
Public methodTiffEncoder(TiffCompression, Boolean)
Initializes a new instance of a TiffEncoder specifying the compression and if the image should be appended to the end of an existing file.
Top
Properties
  NameDescription
Public propertyAppend
Get or sets a value indicating if the image should be appended to the end of an existing file.
Public propertyCompression
Gets or sets a value indicating the compression algorithm used when encoding to a file.
Public propertyIptcTags
Gets or sets IPTC Metadata that will be saved with the image.
Public propertyJpegQuality
Gets or sets the quality level used when saving the image.
Public propertyPhotoshopResources
Gets or sets Photoshop resources to be saved with the image.
Public propertySaveRichTiffIptc
Gets or sets a value indicating that IPTC data will be stored in the TIFFTAG_RICHTIFFIPTC Tag rather than the TIFFTAG_PHOTOSHOP tag.
Public propertyStripSize
Gets or sets the strip size used when saving the image.
Public propertySupportedPixelFormats
Returns an array of pixel formats supported by this encoder.
(Overrides ImageEncoderSupportedPixelFormats.)
Public propertyTiffTags
Gets or sets a collection of TIFF Tags that will be encoded with the image when writing.
Public propertyTileSize
Gets or sets the size of tiles that are saved when WriteTiled is true.
Public propertyUseLzwPredictor
Gets or sets a value indicating LZW predictor.
Public propertyUseOldJpegCompression Obsolete.
When true, JPEG compression will generate old style JPEG in TIFF compression (compression value 6).
Public propertyWriteImageColorProfile
Controls how the TiffEncoder writes color profiles.
Public propertyWriteTiled
Gets or sets a value that when true, will cause TIFF images to be encoded tiled.
Public propertyXmp
Gets or sets XMP data to encode with the image.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIsPixelFormatSupported
Returns true if the given PixelFormat can be encoded with the derived encoder.
(Inherited from ImageEncoder.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnSetEncoderCompression
Called when the encoder needs to select a compression.
(Inherited from MultiFramedImageEncoder.)
Public methodSave(Stream, AtalaImage, ProgressEventHandler)
Encode an AtalaImage as a Tiff image to a stream.
(Overrides ImageEncoderSave(Stream, AtalaImage, ProgressEventHandler).)
Public methodSave(Stream, ImageCollection, ProgressEventHandler)
Saves a collection of images to a multi-page TIFF.
(Overrides MultiFramedImageEncoderSave(Stream, ImageCollection, ProgressEventHandler).)
Public methodSave(Stream, ImageSource, ProgressEventHandler)
Saves the images to the specified stream.
(Overrides MultiFramedImageEncoderSave(Stream, ImageSource, ProgressEventHandler).)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Events
  NameDescription
Public eventSetEncoderCompression
Occurs when the encoder needs to select a compression.
(Inherited from MultiFramedImageEncoder.)
Top
Remarks

This ImageEncoder can be passed into the the AtalaImage or Workspace objects when saving to specify a TIFF image.

Metadata can be written with the TIFF image including EXIF, IPTC, XMP, and Photoshop Resources. See the %Atalasoft.Imaging.Metadata% namespace for more information.

If the image being saved contains a ColorProfile, it will be embedded within the file.

If the image being saved is 1-bit, and palette index 0 is black and palette index 1 is white, the image will be saved with the photometric value of MINISBLACK. If other viewers mistakingly view the image reversed, invert the image and palette data prior to saving.

When compressing TIFF images, it's sometimes useful to adjust the StripSize to something other than the default. In particular, Deflate and LZW compression work better with larger chunks of data.

Examples
Append (C#)
// Load the image you want to append.
AtalaImage image = new AtalaImage(@"D:\Test Images\TIFF\1-bit.tif");

// Create the TiffEncoder and tell it to append to an existing file.
TiffEncoder tiff = new TiffEncoder(TiffCompression.Group4FaxEncoding, true);

// Append the image.
image.Save(@"D:\Test Images\TIFF\append.tif", tiff, null);

image.Dispose();
AppendVB (Visual Basic)
' Load the image you want to append.
Dim image As AtalaImage =  New AtalaImage("D:\Test Images\TIFF\1-bit.tif") 

' Create the TiffEncoder and tell it to append to an existing file.
Dim tiff As TiffEncoder =  New TiffEncoder(TiffCompression.Group4FaxEncoding, True) 

' Append the image.
image.Save("D:\Test Images\TIFF\append.tif", tiff, Nothing)

image.Dispose()
See Also