Welcome to the Creatures Wiki! Log in and join the community.
Difference between revisions of "SPR files"
Jump to navigation
Jump to search
ScoobyGambit (talk | contribs) |
(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]]. | ||
− | + | ||
− | == | + | ==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 | ||
− | = | + | {| border="1" |
− | + | |- | |
+ | ! 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== | ||
− | + | [[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. | |
− | |||
− | |||
− | |||
− | |||
− | = | + | {| border="1" |
− | + | |- | |
− | + | ! 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== | ==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:
- A header, containing information about the file
- Image headers, one for each image
- 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]
- C16 files
- S16 files
- Sprite Thumbnail Viewer - Windows