POV-Ray : Newsgroups : povray.general : TGA files containing HF_Gray_16 data, Question 2 : Re: TGA files containing HF_Gray_16 data, Question 2 Server Time
12 Aug 2024 03:26:57 EDT (-0400)
  Re: TGA files containing HF_Gray_16 data, Question 2  
From: Alexander Enzmann
Date: 7 Apr 1999 11:50:03
Message: <370B70E4.519236CB@mitre.org>
Margus Ramst wrote:
> 
> F.VERBAAS wrote in message <370a6ac6.0@news.povray.org>...
> >
> >You are perfectly right! I mixed up the sequence for 2 byte entries and
> >three byte entries. For some reason the HF_Gray_16 format uses three bytes
> >per pixel.
> >
> 
> A fact that leaves me puzzled. Why was the 24 bit TGA format chosen as the
> container for 16 bit HF info? 1/3 of the file is in effect wasted space...
> Why not use a proprietary format having just 16 bit pixel data? Or even 32
> bit, like the Geoforge format.


A reasonable question, with (I hope) a reasonable answer.

At the time I added 16 bit HF support for TGA images, I wanted to be
able to load the images into viewer programs (this is something like 5-7
years ago and PICLAB, CSHOW, etc were about the best around for use
hobbyists).  16 grey isn't a valid form of TGA file (well, at least it
wasn't considered so by the Truevision engineer I was corresponding with
and no image programs would load it if you put 16 bits into a grey
pixel).  So, I decided that I'd plonk the bits into the red and green
channels of a 24 bit color image.

Note, if you look at the TGA file format specification (yes it is TGA,
not Targa), you could interpret the use of field 3 and field 5.5 to mean
that you can have 16 bit per pixel greyscale images (24 and 32 too). 
Most programs have problems with that.  Just like many programs have a
problem with the use of a non-zero value in field 1.

Xander


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.