UnsupportedPixelFormat GDPicture Status with Jpeg 2000

Discussions about TWAIN & WIA scanning in GdPicture.NET using GdPictureImaging.
Post Reply
asmythee
Posts: 6
Joined: Tue Dec 07, 2010 9:08 pm

UnsupportedPixelFormat GDPicture Status with Jpeg 2000

Post by asmythee » Thu Mar 10, 2011 1:23 am

This code kics off a GDPictureStatus of 62, Unsupported Pixel Format.

We'd really like to use Jpeg 2000. Is there a workaround for creating a byte array?



Thanks,
Mitch

Code: Select all

result = oGdPictureImaging.SaveAsByteArray(ImageID, ba, bytesread, GdPicture.DocumentFormat.DocumentFormatJP2, 95)

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

Re: UnsupportedPixelFormat GDPicture Status with Jpeg 2000

Post by Loïc » Thu Mar 10, 2011 3:54 pm

Hi,

Just convert the image to 24 bpp before saving is as jpeg2000. See: ConverTo24Bpp() method.

Kind regards,

Loïc

asmythee
Posts: 6
Joined: Tue Dec 07, 2010 9:08 pm

Re: UnsupportedPixelFormat GDPicture Status with Jpeg 2000

Post by asmythee » Fri Mar 11, 2011 12:37 am

Thanks Loïc, this worked. I'm now doing:

Code: Select all

oGdPictureImaging.ConvertTo24BppRGB(ImageID)
result = oGdPictureImaging.SaveAsByteArray(ImageID, ba, bytesread, GdPicture.DocumentFormat.DocumentFormatJP2, 5)
Although it's currently running much slower than JPEG. Is this expected, or are there some other settings I might try?

(We're looking closely at Jpeg 2k as there seem to be fewer artifacts when scanning text but it still seems to provide a good compression size.)

Thanks,
Mitch

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest