How to C#: Tiff
Using Tiff SDK for C#.NET
Tiff Color Profile
  |  
Home ›› XDoc.Tiff ›› C# Tiff: Edit Tiff Color Profile

C# TIFF - 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.


Related .net document control helps:
asp.net document viewer: EdgeDoc ASP.NET Document Viewer C# Control: Open, view, annotate, redact, convert documents online using ASP.NET Web Con...
asp.net text document viewer: C# HTML5 Viewer: Load, View, Convert, Annotate and Edit OpenOffice, CSV and Text file
asp.net dnn pdf editor: ASP.NET DNN PDF Editor Control: view, edit PDF files in Dotnetnuke application
asp.net create pdf: ASP.NET Create PDF Document Control: create, convert PDF file from Word, Excel, Tiff file formats in C# ASP.NET
asp.net azure pdf editor: ASP.NET Azure PDF Editor Control: view, edit, annotate, redact PDF files online
asp.net dicom document viewer: ASP.NET Dicom Document Viewer Control: view, annotate dicom imaging files online in ASP.NET
asp.net excel document viewer: ASP.NET Excel Document Viewer in C# Control: view office excel files online in ASP.NET web applications


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.




C# Project DLLs: Edit Color Profile



In order to run the following conversion code, please do as follows:


Add references;


  RasterEdge.Imaging.Basic.dll


  RasterEdge.Imaging.Basic.Codec.dll


  RasterEdge.Imaging.Drawing.dll


  RasterEdge.XDoc.Processing.dll


  RasterEdge.Imaging.Raster.dll


  RasterEdge.Imaging.Raster.Core.dll


  RasterEdge.Imaging.Font.dll


  RasterEdge.XDoc.TIFF.dll


Use corresponding namespaces;


  using RasterEdge.Imaging.Basic;


  using RasterEdge.XDoc.TIFF;


Note: When you get the error "Could not load file or assembly 'RasterEdge.Imaging.Basic' or any other assembly or one of its dependencies. An attempt to load a program with an incorrect format", please check your configure as follows:


If you are using x64 libraries/dlls, Right click the project -> Properties -> Build -> Platform target: x64.


If using x86, the platform target should be x86.




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.