tags:

views:

55

answers:

3

Hi all. I have an image saved in tiff format which is 24 bits per pixel. May I know if there's a program written in C language or java that can convert the 24 bits per pixel to 48 bits per pixel?

+1  A: 

If I was writing such a program in C, I'd start by looking at libtiff. It's pretty straightforward to read and write tiff image data.

The more interesting question is how you convert 24-bit image data to 48-bit. The output is wider than the input, so you have to come up with the missing bits from somewhere. You might naively start by setting the lowest eight bits to zero in each of the three channels, but some sort of interpolation would likely give better results.

There might be some useful tips waiting to be mined from the source to gimp and graphicsmagick. (Indeed, they can probably already do such conversions before breakfast without blinking.)

crazyscot
Hi. Thanks for you reply. How about if u were to write a program using Java?
Have you tried googling? It looks like the Java Advanced Imaging (JAI) API provides some level of TIFF support. Failing that, grab yourself a copy of the TIFF specification and get implementing ...
crazyscot
A: 

I'm not quite sure if it is able to handle 48bit tiffs, but you might want to have a look at imagemagick

Tedil
A: 
cibercitizen1