Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, June 6, 2018 3:53:05 AM(UTC)
Nguyễn minh Vân

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
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Wednesday, June 6, 2018 2:38:10 PM(UTC)
Nick Villalobos

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 VB
Code:
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.

LEAD Logo
 
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.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.053 seconds.