←Select platform

PreserveObjectColor Property

Summary
Gets or sets a value that represents the color of the area to be preserved. To be preserved, the color has to be different than colors in image.
Syntax
C#
C++/CLI
Python
public RasterColor PreserveObjectColor { get; set; } 
public: 
property RasterColor PreserveObjectColor { 
   RasterColor get(); 
   void set (    RasterColor ); 
} 
PreserveObjectColor # get and set (IntelligentDownScaleCommand) 

Property Value

RasterColor value that specifies color of the area in the mask image. To be removed the color has to be different than the rest of the image colors. If no remove color exist, then pass null.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.SpecialEffects; 
 
 
public void IntelligentDownScaleCommandExample() 
{ 
   // Load an image 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Sample3.cmp")); 
 
   IntelligentDownScaleCommand command = new IntelligentDownScaleCommand(); 
   command.DownScalingOrder = 1; 
   command.NewWidth = image.Width - 100; 
   command.NewHeight = image.Height; 
   command.UsePreserveObjectColor = false; 
   command.UseRemoveObjectColor = false; 
 
   // Apply the intelligent downscale on the image. 
   command.Run(image); 
   codecs.Save(image, Path.Combine(LEAD_VARS.ImagesDir, "IntelligentDownScaleResult.jpg"), RasterImageFormat.Jpeg, 24); 
 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 22.0.2023.3.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.ImageProcessing.SpecialEffects Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.