C# TIFF Image Library
Edit Color Profile in C#.NET


Online C# Tutorial for Editing and Processing Color Profile Tag of Tiff Image





TIFF Color Profile Editing in C# Overview



As known to all, Tiff image file format supports embedded color profiles. Commonly, Tiff image color profiles like ICC and ICM are widely used in C#.NET imaging application. RasterEdge XDoc.Tiff for .NET is capable of editing and processing ICC profile tag. On the whole, our SDK supports the following manipulations.

  • Empower C# programmers to embed, remove, add and update ICCProfile

  • Support applying ICCProfile when performing Tiff image color conversions

  • Enable users to save Tiff image file with color profile



In the sections below, we will give you two C# programming examples for how to add color profile tag to Tiff image and how to delete its color profile.



Add Tiff Color Profile in C# Programming



Please use this programming example in your C# project to add ICCProfile to your Tiff image.



// Load your Tiff file.
TIFFDocument doc = new TIFFDocument(@"C:\demo1.tif");
if (null == doc)
	throw new Exception("Fail to construct TIFF Document");

// Get Tiff tag collection.
TagCollection col = doc.GetTagCollection(0);

// Add tag to Tiff file.
TIFFField field = new TIFFField((int)TIFFTag.ICCProfileData, @"C:\sRGB.icc");
col.AddTifTag(field);


Delete Tiff Color Profile in C# Programming



On the contrary, this example will tell you how to remove your Tiff image color profile.



// Load a Tiff document.
TIFFDocument doc = new TIFFDocument(@"C:\demo1.tif");
if (null == doc)
	throw new Exception("Fail to construct TIFF Document");

// Get Tiff tag collection.
TagCollection col = doc.GetTagCollection(0);

// Delete Tiff tag.
col.DeleteTifTag((int)TIFFTag.ICCProfileData);

public TagCollection(GetTagCollection(int pageIdx)

Description:
Get the specified page’s exif , iptc and tiff tag information.

Parameters:

Return:
Null if failed.


public String GetXMPMetadata(int pageIdx)

Description:
Get the specified page’s xmp information.

Parameters:

Return:
Null if failed.









Common Asked Questions

How many colors are in a TIFF?

TIFF can contain millions of colors. A TIFF file with common 24 bits RGB color mode, supports over 16.7 million colors. You can create 24-bit TIFF image file using RasterEdge XDoc.TIFF C# library.

Are TIFF files black and white?

TIFF can be black and white (1-bit tiff), and TIFF can also be in full color or gray scale. You can create 1-bit, 8-bit and 16-bit TIFF image file using RasterEdge XDoc.TIFF C# library.

Can TIFFs be transparent?

TIFF standard supports transparency. When you create a tiff file or export other file format to TIFF file, you can choose Transaprency in option.

Are TIFF files RGB or CMYK?

TIFF standarad supports both RGB and CMYK. When you create or save a TIFF file, you need specify the TIFF color mode either RGB or CMYK. C# TIFF component supports both RGB and CMYK color models in TIFF file.

How to save TIFF in CMYK?

CMYK, short for Cyan, Magenta, Yellow, Key/Black, is a color model used for printing. When you generate, or export a TIFF file, you need choose the TIFF color mode, RGB or CMYK using C# TIFF library.

Is TIFF 8 bit or 16-bit?

TIFF supports 1-bit, 8-bit, 16-bit, and 32-bit color depths. 8-bit is sufficient for most final images and displays. 16-bit TIFF file is about twice the size of an 8-bit TIFF file. C# TIFF library supports both 8-bit and 16-bit TIFF generation in C# projects.

What is the range of 16-bit TIFF?

The range of a 16-bit TIFF file is 0 to 65,535 for an unsigned integer, or -32,768 to 32,767 for a signed integer. Using C# TIFF SDK, you can create or export 16-bit TIFF in C# ASP.NET Core web apps and Windows applications.

Is TIFF always lossless?

TIFF is not always lossless. TIFF supports both lossless (such as LZW) and lossy image compression (such as JPEG). Using C# TIFF library, you can chhose LZW or JPEG to create TIFF with lossless or lossy compression in C# application.

Why is TIFF blurry?

Your converted TIFF file may be blurry, because of the following reasons during conversion
  • Incorrect image resizing
  • Low resolution for printing
  • Improper conversion settings. Some compression formats may reduce image quality.
  • A low bit depth
When you are creating or converting to TIFF file, you can customize the generated TIFF to avoid generating blurry TIFF file using C# TIFF library.

What is an ICC profile?

An ICC profile is a digital file that instructs a device on how to display or reproduce colors. XDoc.TIFF C# library supports ICC profile file adding, removing, and editing from a TIFF file in C# ASP.NET Core, MVC, web and Windows applications.