Welcome to the Creatures Wiki! Log in and join the community.

Difference between revisions of "SPR files"

From Creatures Wiki
Jump to navigation Jump to search
(Undo revision 69914 by 185.220.101.20 (talk))
Tag: Undo
 
(10 intermediate revisions by 5 users not shown)
Line 1: Line 1:
The .spr [[Sprite]] image file extension is associated with [[Creatures 1]]. These files store a number of images with 8-bit color, so each COB usually only needs one SPR file.  They can be viewed and edited with Creature Labs' [[Sprite Workshop]], [[BoBCoB|BoBCoB Sprite Editor]], and previewed in Windows using [[GreenReaper|GreenReaper's]] [[Sprite Thumbnail Viewer]].
+
The .spr [[Sprite]] image file extension is associated with [[Creatures 1]]. These files store a number of images with 8-bit color, so each COB usually only needs one SPR file.  They can be viewed and edited with Creature Labs' [[Sprite Workshop]], [[BoBCoB|BoBCoB Sprite Editor]], and previewed in Windows using [[GreenReaper|GreenReaper's]] [[Sprite Thumbnail Viewer]]. A variant format, also using the extension .spr, was used in [[Creatures 0|old pre-Creatures-1 prototypes]].
  
 
You can find the file naming convention [[Sprite|here]].
 
You can find the file naming convention [[Sprite|here]].
__NOTOC__
+
 
==Overview==
+
==File Format==
 
An SPR file consists of three distinct parts:
 
An SPR file consists of three distinct parts:
  
Line 10: Line 10:
 
#The image data
 
#The image data
  
===File header===
+
{| border="1"
*uint16: Number of images in the file
+
|-
 +
! type          !! description
 +
|-
 +
| uint16      || number of images in the file
 +
|-
 +
| uint32      || offset to first image
 +
|-
 +
| uint16      || width of first image
 +
|-
 +
| uint16       || height of first image
 +
|-
 +
| ...          || offset, width, and height of rest of images
 +
|-
 +
| image width * image height || Data for first image. Each byte is  a reference to palette colour id, 0 to 255. The actual image data is simply color indexes arranged into horizontal scanlines. The mappings between color indices and 256 RGB colors is given in the [[PALETTE.DTA]] file; Multiply the red, green and blue results returned by 4 to gain the full colour range.
 +
|-
 +
| ...            || data for rest of images
 +
|}
 +
 
 +
==''Creatures'' prototypes==
  
===Image header===
+
[[Creatures 0|Prototypes prior to Creatures 1]] used a slightly different format, with smaller integer encodings. [[Spritist]] can be used to view them and convert them to other formats.
Then, for each image, there is an image header containing:
 
*uint32: Offset to beginning of first line in image data
 
*uint16: Image width in pixels
 
*uint16: Image height in pixels
 
  
===Image data===
+
{| border="1"
For each of the specified number (i.e. image width * image height) of pixels in each image:
+
|-
*uint16: Reference to palette colour id, one byte, 0 to 255
+
! size          !! description
The actual image data is simply color indexes arranged into horizontal scanlines. The mappings between color indices and 256 RGB colors is given in the [[PALETTE.DTA]] file; Multiply the red, green and blue results returned by 4 to gain the full colour range.
+
|-
 +
| uint16      || number of images in the file
 +
|-
 +
| uint16      || offset to first image
 +
|-
 +
| uint8      || width of first image
 +
|-
 +
| uint8      || height of first image
 +
|-
 +
| ...           || offset, width, and height of rest of images
 +
|-
 +
| image width * image height || Data for first image. Each byte is  a reference to palette colour id, 0 to 255.
 +
|-
 +
| ...           || data for rest of images
 +
|}
  
 
==Utilities==
 
==Utilities==
Line 29: Line 57:
 
*[[BoBCoB|BoBCoB SpriteEditor]].
 
*[[BoBCoB|BoBCoB SpriteEditor]].
 
*[[Sprite Workshop]]
 
*[[Sprite Workshop]]
 +
*[[Spritist]]
  
 
==References==
 
==References==
Line 37: Line 66:
 
* [[C16 files]]
 
* [[C16 files]]
 
* [[S16 files]]
 
* [[S16 files]]
 +
* [[Sprite Thumbnail Viewer]] - Windows
  
 
==External Links==
 
==External Links==

Latest revision as of 12:09, 21 March 2024

The .spr Sprite image file extension is associated with Creatures 1. These files store a number of images with 8-bit color, so each COB usually only needs one SPR file. They can be viewed and edited with Creature Labs' Sprite Workshop, BoBCoB Sprite Editor, and previewed in Windows using GreenReaper's Sprite Thumbnail Viewer. A variant format, also using the extension .spr, was used in old pre-Creatures-1 prototypes.

You can find the file naming convention here.

File Format[edit]

An SPR file consists of three distinct parts:

  1. A header, containing information about the file
  2. Image headers, one for each image
  3. The image data
type description
uint16 number of images in the file
uint32 offset to first image
uint16 width of first image
uint16 height of first image
... offset, width, and height of rest of images
image width * image height Data for first image. Each byte is a reference to palette colour id, 0 to 255. The actual image data is simply color indexes arranged into horizontal scanlines. The mappings between color indices and 256 RGB colors is given in the PALETTE.DTA file; Multiply the red, green and blue results returned by 4 to gain the full colour range.
... data for rest of images

Creatures prototypes[edit]

Prototypes prior to Creatures 1 used a slightly different format, with smaller integer encodings. Spritist can be used to view them and convert them to other formats.

size description
uint16 number of images in the file
uint16 offset to first image
uint8 width of first image
uint8 height of first image
... offset, width, and height of rest of images
image width * image height Data for first image. Each byte is a reference to palette colour id, 0 to 255.
... data for rest of images

Utilities[edit]

The following utilities can be used to edit SPR files:

References[edit]

See Also[edit]

External Links[edit]