ConvertTo8BppGrayScale() saves images as 256 Color

Discussions about image processing and document imaging.
Post Reply
lokelo
Posts: 17
Joined: Fri Mar 28, 2008 9:00 pm

ConvertTo8BppGrayScale() saves images as 256 Color

Post by lokelo » 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.

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)


User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: ConvertTo8BppGrayScale() saves images as 256 Color

Post by Loïc » Thu Aug 07, 2008 4:53 pm

Hi,

You are right.

I fixed this issue into the last fixed released -> https://www.gdpicture.com/softwares.php ;)

Best regards,

Loîc

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest