LEADTOOLS Support
Imaging
Imaging SDK Questions
Help with loading image and altering hue, saturation
#1
Posted
:
Wednesday, June 6, 2018 3:53:05 AM(UTC)
Groups: Registered
Posts: 1
I am trying to figure out how to load an image (jpg or otherwise) from my HD into a RasterImageViewer (or other object), alter the hue, saturation, etc... and finally save the file.
I am coding in VB.NET so a VB.NET example would be prefered.
Thanks in advance
#2
Posted
:
Wednesday, June 6, 2018 2:38:10 PM(UTC)
Groups: Registered
Posts: 119
Was thanked: 4 time(s) in 4 post(s)
Hello,
Below you will find a link that will take you through a step by step example of you can load and display an image using the LEADTOOLS SDK:
This is a Windows application tutorial that is written in both VB and C#, and is great if you are just starting to testing the toolkit's functionalities.
Once you have this done and working you would want to take a loot at our
ColorReplaceCommand Class.
- This command replaces the specified color by adjusting value of hue, saturation and brightness. The value of the Fuzziness property of the ColorReplaceCommandColor class determines the range around each color where the pixels will be changed according to Hue, Saturation and Brightness.
- 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 signed data images.
- This command does not support 32-bit grayscale images
For more information, please take a look our
Correcting Colors page.
How to use the ColorReplaceCommand in VBCode:Dim codecs As New RasterCodecs()
codecs.ThrowExceptionsOnInvalidImages = True
Dim leadImage As RasterImage = codecs.Load("PATH OF INPUT FILE")
' Prepare the command
Dim command As ColorReplaceCommand = New ColorReplaceCommand
Dim Data() As ColorReplaceCommandColor
ReDim Data(0)
Data(0) = New ColorReplaceCommandColor
Data(0).Color = New RasterColor(200, 0, 35)
Data(0).Fuzziness = 300
command.Colors = Data
command.Hue = 9000
command.Saturation = 0
command.Brightness = 0
' Run the commands on loaded image
command.Run(leadImage)
' Save new image
codecs.Save(leadImage, "PATH TO DESTINATION LOCATION", RasterImageFormat.Jpeg, 24)
Nick Villalobos
Developer Support Engineer
LEAD Technologies, Inc.
LEADTOOLS Support
Imaging
Imaging SDK Questions
Help with loading image and altering hue, saturation
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.