1 | # ase-parser
|
2 | Parse Aseprite files with Node.js, no external dependencies
|
3 |
|
4 |
|
5 | ## Aseprite Object
|
6 | | Field | Type | Description |
|
7 | |--------------|------------------------|----------------------------------------|
|
8 | | frames | array of [frame](#frame-object) objects | frames |
|
9 | | layers | array of [layer](#layer-object) objects | layers |
|
10 | | fileSize | integer | size of the file (in bytes) |
|
11 | | numFrames | integer | number of frames the Aseprite file has |
|
12 | | width | integer | width (in pixels) |
|
13 | | height | integer | height (in pixels) |
|
14 | | colorDepth | integer | color depth (in bits per pixel) |
|
15 | | numColors | integer | number of colors |
|
16 | | pixelRatio | string | width:height |
|
17 | | name | string | name of the file |
|
18 | | tags | arry of [tag](#tag-object) objects | tags |
|
19 | | colorProfile | [colorProfile](#color-profile-object) object | Color profile |
|
20 | | palette | [palette](#palette-object) object | Palette |
|
21 |
|
22 | ## Frame Object
|
23 | | Field | Type | Description |
|
24 | |---------------|-----------------------|------------------|
|
25 | | bytesInFrame | integer | size (in bytes) |
|
26 | | frameDuration | integer | duration (in ms) |
|
27 | | cels | array of [cel](#cel-object) objects | cels |
|
28 |
|
29 | ## Layer Object
|
30 | | Field | Type | Description |
|
31 | |-----------------|---------|---------------------|
|
32 | | flags | integer | flags for the layer |
|
33 | | type | integer | type |
|
34 | | layerChildLevel | integer | layer child level |
|
35 | | opacity | integer | opacity (0-255) |
|
36 | | name | string | name of layer |
|
37 |
|
38 |
|
39 | ## Tag Object
|
40 | | Field | Type | Description |
|
41 | |---------------|---------|----------------------------------------|
|
42 | | from | integer | first frame index |
|
43 | | to | integer | last frame index |
|
44 | | animDirection | string | `Forward`, `Reverse` or `Ping-pong` |
|
45 | | color | string | hex color of the tag (no `#` included) |
|
46 | | name | string | name |
|
47 |
|
48 | ## Color Profile Object
|
49 | | Field | Type | Description |
|
50 | |--------|---------|-------------------------|
|
51 | | type | string | `None`, `sRGB` or `ICC` |
|
52 | | flag | integer | fixed gamma flag |
|
53 | | fGamma | integer | fixed gamma |
|
54 | | icc? | buffer | ICC profile data |
|
55 |
|
56 | ## Palette Object
|
57 | | Field | Type | Description |
|
58 | |-------------|------------------------|--------------------------|
|
59 | | paletteSize | integer | number of colors |
|
60 | | firstColor | integer | index of the first color |
|
61 | | lastColor | integer | index of the last color |
|
62 | | colors | array of [color](#color-object) objects | colors |
|
63 |
|
64 | ## Cel Object
|
65 | | Field | Type | Description |
|
66 | |------------|---------|----------------------------------------------|
|
67 | | layerIndex | integer | index of the layer associated |
|
68 | | xpos | integer | x position of the cel compared to the sprite |
|
69 | | ypos | integer | y position of the cel compared to the sprite |
|
70 | | opacity | integer | opacity (0-255) |
|
71 | | celType | integer | internally used |
|
72 | | w | integer | width (in pixels) |
|
73 | | h | integer | height (in pixels) |
|
74 | | rawCelData | Buffer | raw cel pixel data |
|
75 |
|
76 | ## Color Object
|
77 | | Field | Type | Description |
|
78 | |-------|---------|-----------------------------------------------|
|
79 | | red | integer | red value (0-255) |
|
80 | | green | integer | green value (0-255) |
|
81 | | blue | integer | blue value (0-255) |
|
82 | | alpha | integer | alpha value (0-255) |
|
83 | | name | string | 'none' or the actual color name if it has one |
|
84 |
|
85 | # Further Info
|
86 |
|
87 | If you would like to read up on the Aseprite file spec: [Spec](https://github.com/aseprite/aseprite/blob/master/docs/ase-file-specs.md) |
\ | No newline at end of file |