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 pdf editor control: EdgePDF: ASP.NET PDF Editor Web Control: Online view, annotate, redact, edit, process, convert PDF documents
asp.net edit pdf page: ASP.NET PDF Pages Edit Control: add, remove, sort, replace PDF pages online using C#
mvc pdf editor: ASP.NET MVC PDF Viewer & Editor: view, annotate, redact, edit PDF document in C# ASP.NET MVC
asp.net excel web viewer: ASP.NET Excel Viewer in C# Control (MVC & WebForms): view Office Excel document in web browser.
asp.net tiff viewer control: ASP.NET Tiff Viewer: view, annotate multipage Tiff images in ASP.NET MVC, WebForms using C# Control
asp.net annotate pdf: ASP.NET Annotate PDF Control: annotate, comment, markup PDF document online using ASP.NET C#
asp.net ppt viewer: ASP.NET PowerPoint Document Viewer Control (MVC & WebForms): view ppt, pptx files online in C# using ASP.NET


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.