VFX All about Targa -

All about Targa

TGA (True vision Graphic Adapter), popularly known as ‘TARGA'(Truvision Advanced Raster Graphics Array ) can be recognized by the “.tga”.TGA is a raster (A raster graphics image, digital image, or bitmap, representing a generally rectangular grid of pixels, or points of color, on a computer monitor, paper, or other display device) graphic file format. It is the native format of’TRUEVISION INC’.Targa boards were some of the first graphics card for IBM compatible Pc’s to support true colour.

This format can store up to 1 to 32 bits per pixel. The tga format was originally developed by ‘TRUEVISION INC’S ‘BRAD PILLOW’ in the year 1984.Several modifications were made since then and they were introduced in the year 1989.Despite its limited colour depth,tga is still used extensively throughout the animation domain.

Early work on ‘tga’file format was performed at EPICentre, a division of ‘AT&T’. The first product of EPICentre was called VDA (Video Display Adapter) which had the resolution of 256×200 pixels.

‘TGA’ image file format supports a compression known as ‘RLE (Run Length Encoding)’ RLE is a lossless compression algorithm. It is the easiest compression of all like that of Jpeg, LZW which is used for compressing images in GIF file format or also TIFF which supports many compression algorithms like LZW,CCIT etc.

Let’s see an example which demonstrates ‘RLE’ compression algorithm.

Suppose the following string of data has to be compressed
Original string: A B B B B B B B B B C D E E E E F (17 bytes)

Using ‘RLE’ compression the compressed files takes up to 10 bytes and could like this – ‘RLE’ compressed string: A *9B C D *4E F (10 bytes)

In this repetitive strings of data are replaced by a control character (*) followed by the number of repeated characters itself. The control character is not fixed, it depends on the process of one implentation to another. If the control character itself appears in the file, then one extra character is coded (that means ‘*’ is taken as a separate character)

It is very important to know that there are many ‘RLE encoding schemes’. The above example is one the basic schemes that demonstrates the basic ‘RLE’ encoding. Now we will see other example which employs ‘RLE’encoding having different scheme then which was used in the above example.

In this scheme all the original data is scanned in rows and converted into count byte. There are two types of grouping which is done in this case. The first group is of run, which is of repeating values. This is encoded as the count of repetitive values followed by the value itself, such that a run of ‘n’ bytes is given count as ‘1-n’.The second group is a sequence of non repeating group such that a sequence of ‘j’ bytes is given count as ‘j-1’. RLE is a compression method that converts consecutive identical characters into a code consisting of the character and the number marking the length of the run. The longer the run, the greater the compression.

The example below shows the ‘RLE’encoding for five repetitions of ‘A’ and then sequence BCDE. The run is encoded as ‘-4′(since number of repetitions of ‘A’ is 5, hence run =1-n that means 1-5= – 4) and the sequence is encoded as count3 (Since sequence of non repeating bytes = 4, therefore we have ‘j-1’which is equal to ‘4-1=3) followed by ‘BCDE’.

Likewise there are other schemes also which are used in ‘RLE encoding’.
Advantages of ‘RLE’encoding

1. This algorithm is very easy to implement and it does not take much of the CPU power.

Disadvantages of ‘RLE’encoding

1. It works efficiently with the files having lots of image data.

‘RLE’compression algorithm can be used in file formats like ‘TIFF’ files and also for the images in ‘PDF'(Portable Document File).The ‘tga’ image file format became popular because it was amongst the first ’24bit’,truecolour bitmap format.

connect@animationxpress.com