←Select platform

Lightness Property

Summary
Gets or sets a "percentage" value that indicates whether the pixels that are replaced are lightened or darkened.
Syntax
C#
C++/CLI
Python
public int Lightness { get; set; } 
public: 
property int Lightness { 
   int get(); 
   void set (    int ); 
} 
Lightness # get and set (RemoveRedEyeCommand) 

Property Value

"Percentage" value that indicates whether the pixels that are replaced are lightened or darkened. If this value is greater than 100, the replaced pixels will be lightened. If this value is less than 100, the replaced pixels will be darkened. This method preserves the lightness of the original pixels and substitutes the red color with the new color.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.Color; 
 
 
public void RemoveRedEyeCommandExample() 
{ 
   // Load an image 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "red_eye.cmp")); 
 
   // Prepare the command 
   RemoveRedEyeCommand command = new RemoveRedEyeCommand(); 
   //Apply the redeye removal command. 
   command.NewColor = new RasterColor(5, 20, 10); 
   command.Threshold = 125; 
   command.Lightness = 100; 
   command.Run(image); 
   codecs.Save(image, Path.Combine(LEAD_VARS.ImagesDir, "Result.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.Color Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.