public class GammaCorrectCommand : RasterCommand
Public Class GammaCorrectCommand
Inherits RasterCommand
@interface LTGammaCorrectCommand : LTRasterCommand
public class GammaCorrectCommand extends RasterCommand
public ref class GammaCorrectCommand : public RasterCommand
For more information, refer to Changing Brightness and Contrast.
If the image has a LUT and you want to work on the image data, set RasterImage.UseLookupTable to false. Then, after calling the method, reset the UselookupTable property to true, as follows:
rasterImage.UseLookupTable = false;
Method(rasterImage);
rasterImage.UseLookupTable = true;
Run the GammaCorrectCommand on an image and apply gamma correction.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Color;
public void GammaCorrectCommandExample()
{
// Load an image
RasterCodecs codecs = new RasterCodecs();
codecs.ThrowExceptionsOnInvalidImages = true;
RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "sample5.cmp"));
// Prepare the command
GammaCorrectCommand command = new GammaCorrectCommand();
//Set a gamma value of 2.5.
command.Gamma = 250;
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:\LEADTOOLS21\Resources\Images";
}
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.ImageProcessing.Color
Public Sub GammaCorrectCommandExample()
Dim codecs As New RasterCodecs()
codecs.ThrowExceptionsOnInvalidImages = True
Dim leadImage As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "sample5.cmp"))
' Prepare the command
Dim command As GammaCorrectCommand = New GammaCorrectCommand
'Set a gamma value of 2.5.
command.Gamma = 250
command.Run(leadImage)
codecs.Save(leadImage, Path.Combine(LEAD_VARS.ImagesDir, "Result.jpg"), RasterImageFormat.Jpeg, 24)
End Sub
Public NotInheritable Class LEAD_VARS
Public Const ImagesDir As String = "C:\LEADTOOLS21\Resources\Images"
End Class
Leadtools.ImageProcessing.Color Namespace
Changing Brightness and Contrast
HistogramContrastCommand Class
HistogramEqualizeCommand Class
Leadtools.ImageProcessing.FillCommand
Leadtools.ImageProcessing.Core.WindowLevelCommand
Leadtools.ImageProcessing.Effects.DeinterlaceCommand
Leadtools.ImageProcessing.Effects.EdgeDetectStatisticalCommand
Leadtools.ImageProcessing.Effects.SmoothEdgesCommand
LocalHistogramEqualizeCommand Class
Leadtools.ImageProcessing.Core.CorrelationListCommand
GrayScaleToDuotoneCommand Class
GrayScaleToMultitoneCommand Class
Leadtools.ImageProcessing.Core.HolePunchRemoveCommand
Leadtools.ImageProcessing.Effects.SkeletonCommand
ChangeHueSaturationIntensityCommand Class
MathematicalFunctionCommand Class
ApplyMathematicalLogicCommand Class
ColorIntensityBalanceCommand Class
Leadtools.ImageProcessing.Core.ColorizeGrayCommand
ContrastBrightnessIntensityCommand Class
Leadtools.ImageProcessing.Core.DigitalSubtractCommand
Leadtools.ImageProcessing.Effects.EdgeDetectEffectCommand
Leadtools.ImageProcessing.SpecialEffects.FunctionalLightCommand
Leadtools.ImageProcessing.Core.MultiscaleEnhancementCommand
Leadtools.ImageProcessing.Core.SelectDataCommand
Leadtools.ImageProcessing.Core.ShiftDataCommand
GammaCorrectCommand Class
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