←Select platform

SharpenCommand Class

Summary
Increases or decreases the sharpness of a specific image.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public class SharpenCommand : RasterCommand 
@interface LTSharpenCommand : LTRasterCommand 
public class SharpenCommand 
    extends RasterCommand 
public ref class SharpenCommand : public RasterCommand   
class SharpenCommand(RasterCommand): 
Remarks
  • Negative sharpness values decrease the sharpness of the image. Specify -1000 for minimum sharpness. Positive sharpness values increase the sharpness. Specify +1000 for maximum sharpness.
  • This command supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.
  • This command does not support 32-bit grayscale images.
  • This command supports signed/unsigned data images.

For more information, refer to Detecting and Enhancing Edges and Lines.

Sharpen Function - Before

Sharpen Function - Before

Sharpen Function - After

Sharpen Function - After

View additional platform support for this Sharpen function.

Example

Run the SharpenCommand on an image and increases its sharpness.

C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.Effects; 
 
 
public void SharpenCommandCommandExample() 
{ 
   // Load an image 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "IMAGE1.CMP")); 
 
   // Prepare the command 
   SharpenCommand command = new SharpenCommand(); 
   //Increase the sharpness by 25 percent  of the possible range. 
   command.Sharpness = 950; 
   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.Effects Assembly

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