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);
|
Related API(s) (TIFFDocument.cs):
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.