public byte[] InputProfileData { get; set; }
InputProfileData # get and set (ConversionParameters)
A byte array that contains information about the input memory profile to be used as the input profile.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ColorConversion;
using Leadtools.ImageProcessing;
public string outputFile = Path.Combine(LEAD_VARS.ImagesDir, "ConvertImage.png");
public void ConvertImageExample()
{
// StartUp the ColorConversion.
RasterColorConverterEngine.Startup();
// Input file name
string inputFileName = Path.Combine(LEAD_VARS.ImagesDir, "11800-Embedded_RGB.png");
// Load the original image
using (RasterCodecs codecs = new RasterCodecs())
using (RasterImage image = codecs.Load(inputFileName, 24, CodecsLoadByteOrder.Bgr, 1, 1))
{
// Set the active method
ConversionParameters conversionParameters = new ConversionParameters();
conversionParameters.Method = ConversionMethodFlags.UseCustomIcc;
conversionParameters.ActiveMethod = ConversionMethodFlags.UseCustomIcc;
// Read the embedded profile from image on disk
bool hasProfile = IccProfileExtended.ImageHasIccProfile(inputFileName, 1);
Debug.WriteLine("Profile present:\t" + hasProfile);
IccProfileExtended icc = new IccProfileExtended();
icc.ReadFromImage(inputFileName, 1);
// Use the image profile as the input profile
conversionParameters.InputProfileData = icc.Data;
// Convert the image
using (RasterColorConverterEngine colorConverterEngine = new RasterColorConverterEngine())
{
colorConverterEngine.Start(ConversionColorFormat.Bgr, ConversionColorFormat.Bgr, conversionParameters);
colorConverterEngine.ConvertImage(image);
colorConverterEngine.Stop();
}
// Save output image
codecs.Save(image, outputFile, image.OriginalFormat, image.BitsPerPixel);
// Shutdown the ColorConversion
RasterColorConverterEngine.Shutdown();
}
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images";
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.