Colors incorrect when saving images with gray-scale.

Discussions about TWAIN & WIA scanning in GdPicture.NET using GdPictureImaging.
Post Reply
ikary
Posts: 3
Joined: Mon Oct 15, 2007 11:39 am

Colors incorrect when saving images with gray-scale.

Post by ikary » Mon Oct 15, 2007 12:06 pm

Hi, I got wrong colors on saving gray-scale images to jpeg file.
Hope someone can tell me how to fix it. Here is my steps:(VB 6.0 code)

Code: Select all

........
twain1.TwainSetCurrentPixelType(1)
twain1.TwainSetCurrentBitDepth(8)
twain1.TwainAcquireToImageID(Me.hWnd)
twain1.SaveAsTiff("test1.tif", 6)
twain1.SaveAsJpeg("test2.jpg", 100)
.......
I got a test1.tif with 256 colors which is what I expected.
But the test2.jpg(looks no different with test1.tif) is a 24-bit true color image, not a 8-bit gray-scale image? Did I miss something?

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

Post by Loïc » Mon Oct 22, 2007 2:55 pm

Hi,

For the moment the gdpicture components are enabled to save jpeg files as 24 bit per pixel color depth only. If you want to save as indexed colors file you need to use the gif, bmp or tif encoders.

Regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests