Loading...

Colors incorrect when saving images with gray-scale.

Support for GdTwain ActiveX and GdTwain Pro ActiveX/SDK.

Colors incorrect when saving images with gray-scale.

Postby 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?
ikary
 
Posts: 3
Joined: Mon Oct 15, 2007 11:39 am

Postby 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
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4441
Joined: Tue Oct 17, 2006 10:48 pm
Location: France


Return to GdTwain [Pro] ActiveX

Who is online

Users browsing this forum: No registered users and 1 guest