User Tools

Site Tools


formats:frm16

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
formats:frm16 [2011-11-17 02:41] edheldilformats:frm16 [2011-11-21 22:36] (current) – [Scanline Lookup Table, LUT] edheldil
Line 1: Line 1:
 ==== FRM16 ==== ==== FRM16 ====
  
-*.frm16 files are simple bitmap images, used for many things like UI elements, icons, minimaps, textures, portraits ... In Lionheart, even more of them is actually embedded in .SEQ16 and .MDL16 files. They use 16 bits per color and 8 bits for transparency (the older format probably used between 2 and 3 bits for transparency).+*.frm16 files are simple bitmap images, used for many things like UI elements, icons, minimaps, textures, portraits ... In Lionheart, even more of them is actually embedded as frames in .SEQ16 and .MDL16 files. They use 16 bits per color and 8 bits for transparency (the older format probably used between 2 and 3 bits for transparency).
  
-Allegedly they are cached form of .FRM files which in turn are created from .TGA files. To speed up loading, they do not use any JPEG-type compression like FRM files and use only RLE and 16bit colors. They reside in Cache/ subdir, which supports the theory. In some related games (Ricochet) it's allegedly possible to delete .FRM16 files and get them recreated automatically from FRM files. Unfortunately there are not any .FRM files in Lionheart. +Supposedly they are cached form of .FRM files which in turn are created from .TGA files. To speed up loading, they do not use any JPEG-type compression like FRM files and use only RLE and 16bit colors. They reside in Cache/ subdir, which supports the theory. In some related games (Ricochet) it's allegedly possible to delete .FRM16 files and get them recreated automatically from FRM files. Unfortunately there are not any .FRM files in Lionheart. 
  
 FRM16 file consists of a header and up to five layers. Each layer consists of pixel data followed by a lookup table to first pixels of each image row. FRM16 file consists of a header and up to five layers. Each layer consists of pixel data followed by a lookup table to first pixels of each image row.
Line 9: Line 9:
 Depending on a file type, pixels are either uncompressed (type 64), or RLE-compressed (file type 68). Only the type 68 allows transparency. Depending on a file type, pixels are either uncompressed (type 64), or RLE-compressed (file type 68). Only the type 68 allows transparency.
  
-Layers originally probably were a way to encode alpha (transparency) in FRM16 files - the first layer would be opaque (possibly with fully transparent pixels in type 68), the second layer would be 80% opacity and so on with the fifth one being 20% opacity. +In the older incarnations of the format, layers were probably a way to encode alpha (transparency) in FRM16 files - the first layer would be opaque (possibly with fully transparent pixels in type 68), the second layer would be 80% opacity and so on with the fifth one being 20% opacity. 
  
-However in Lionheart the layers are used differently. If the image is type 68, the first layer is the same as above, but the second and third layers are never used. The fifth layer contains pixels which are semitransparent - but only the RGB colors. The alpha information for the fifth layer is in the fourth layer, but WITHOUT the RLE information. In other words, the alpha layer is unusable without the RGB one. It's stupid and makes incremental loading of type 68 images complicated.+However in Lionheart the layers are used differently. If the image is type 68, the first layer is the same as above, but the second and third layers are never used. The fifth layer contains pixels which are semitransparent - but only their RGB colors. The alpha information for the fifth layer is in the fourth layer, but WITHOUT the RLE information. In other words, the alpha layer is unusable without the RGB one. It's stupid and makes incremental loading of type 68 images complicated.
  
 Perhaps the 2nd and 3rd layers, unused in Lionheart, could be reused for height and normal maps for fake 3D effect (2.5D). Perhaps the 2nd and 3rd layers, unused in Lionheart, could be reused for height and normal maps for fake 3D effect (2.5D).
  
 +==== Header ====
  
 Header (36 bytes) Header (36 bytes)
 ^ Offset ^ Size ^ Description  ^ ^ Offset ^ Size ^ Description  ^
 | 0x00 | 2 | Signature (0x1032) | | 0x00 | 2 | Signature (0x1032) |
-| 0x02 | 2 | Anchor X +| 0x02 | 2 | Anchor X | 
-| 0x04 | 2 | Anchor Y |+| 0x04 | 2 | Anchor Y |
 | 0x06 | 2 | Width in pixels (portraits = 90, areas = 779) | | 0x06 | 2 | Width in pixels (portraits = 90, areas = 779) |
 | 0x08 | 2 | Height in pixels (portraits = 111, areas = 330) | | 0x08 | 2 | Height in pixels (portraits = 111, areas = 330) |
Line 26: Line 27:
 | 0x0c | 2 | Type (64 or 68) | | 0x0c | 2 | Type (64 or 68) |
 | 0x0e | 2 | Unknown, possibly padding, always 0 in standalone files | | 0x0e | 2 | Unknown, possibly padding, always 0 in standalone files |
-| 0x10 | 4 | Bitmap size for opaque layer | +| 0x10 | 4 | Bitmap size for the 1st, opaque layer | 
-| 0x14 | 4 | Bitmap size for 80?% layer | +| 0x14 | 4 | Bitmap size for the 2nd layer, unused 
-| 0x18 | 4 | Bitmap size for 60?% layer | +| 0x18 | 4 | Bitmap size for the 3rd layer, unused 
-| 0x1c | 4 | Bitmap size for 40?% layer | +| 0x1c | 4 | Bitmap size for the 4th layer, alpha 
-| 0x20 | 4 | Bitmap size for 20?% layer |+| 0x20 | 4 | Bitmap size for the 5th layer, RGB |
  
 ==== Layers ==== ==== Layers ====
Line 60: Line 61:
  
 ^ Offset ^ Size ^ Description ^ ^ Offset ^ Size ^ Description ^
-| 0x00 | | Offset of the 1st scanline (0 in type 64 files, 4 in type 68 files) | +| 0x00 | | Offset of the 1st scanline (0 in type 64 files, 4 in type 68 files) | 
-0x02 | Offset of the 2nd scanline |+0x04 | Offset of the 2nd scanline |
 | ...||| | ...|||
-| height * | Offset of the last scanline |+| height * 4 - 4 | Offset of the last scanline |
  
 ==== References ==== ==== References ====
formats/frm16.txt · Last modified: 2011-11-21 22:36 by edheldil