Creating an image from 16 bit unsigned integer

Sweety
07-21-2003, 08:20 PM
I have a 2-D 16 bit unsigned array. How to create an image (bitmap or tiff ot etc) in a very high speed ?


The size can go up to 2000 x 1000.

I tried using for loop to convert this to 8 bit and save it to file by adding the header, but it's very slow....

Can anyone help ??????

BillSoo
07-21-2003, 10:47 PM
If the 16 bits represent pixels using 16bit hi colour mode, you could probably use setdibits to copy the data to an existing image with the proper dimensions.

The slowest part about the way you were doing it is probably when you save to disk. Are you saving byte by byte? If so, you can vastly improve your speed by converting the entire array to 8 bits, then writing the entire array in one operation.

Sweety
07-22-2003, 12:31 AM
My image can only be displayed in 8 bit or 24 bit.

Will try converting it into 8 bit first then write to file.

Thanks.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum