ConvertTo8BppGrayScale() saves images as 256 Color
Posted: Wed Aug 06, 2008 4:44 pm
When I convert an image to grayscale using ConvertTo8BppGrayScale and then check the properties of the image in either Image Professional or ACDSee they both report that the image is 256 colors and not GrayScale or 256 shades of gray. Image professional will allow me to change it to 256 shades of gray and after that i do not see a change in the file, but it may lead to confusion for others who look at the file properties.
Here is the code i'm using below.
I'm using version 5.6.4.
Here is the code i'm using below.
I'm using version 5.6.4.
Code: Select all
Dim img As New cImaging
Dim stat As GdPictureStatus
Dim intImgId As Integer
Dim strInFile, strOutFile As String
strInFile = "C:\temp\0001I08.TIF"
strOutFile = "C:\temp\GS0001I08.TIF"
img.SetLicenseNumber("XXX")
intImgId = img.CreateImageFromFile(strInFile)
stat = img.GetStat
Console.WriteLine(img.GetPixelDepth) '24
img.ConvertTo8BppGrayScale()
stat = img.SaveAsTIFF(strOutFile, TifCompression.CompressionLZW)