1
------------------------------
2
XJT Fileformat specification:
3
------------------------------
5
(XJT 1.1.16b, 2000.02.05) unit
6
(XJT 1.1.15b, 2000.01.30) paths
7
(XJT 1.1.15a, 2000.01.23)
8
(XJT 1.1, 1998.10.31 - 1999.03.16)
10
XJT Fileformat was designed to save compressed GIMP Images with
11
all the properties that are available in GIMP.
13
XJT uses JPEG compression foreach layer or channel and TAR to
14
collect all layers in one file. (Layers with alphachannels
15
are splitted into 2 jpeg files)
17
Additional property informations about offsets, opacity, layernames etc..
18
are stored in the readable textfile called "PRP" (Properties)
20
The resulting tar-file is optionaly compressed a 2.nd time
22
(depends on the filename ending "gz" or "bz2")
24
Filename Extensions are:
25
image.xjt # plain tar file
26
image.xjtgz # gzip compressed tar file
27
image.xjbz2 # bzip2 compressed tar file
31
** XJT does not support INDEXED Images. **
36
Why should anyone use the new XJT Fileformat ?
37
---------------------------------------------
41
- The high JPEG compression rates (1:10 and more) helps
42
to save a lot of Diskspace.
43
(especially if you are using GIMP and GAP to
44
store many images as AnimFrames )
46
- Saved image keeps all layers channels and properties
48
- single Layers can be extracted using tar
49
and then be accessed by many other
50
jpeg-compatible programs.
55
- JPEG is a lossy compression.
56
After save and load the bitmapdata
57
differs a little from the original,
58
depending on the used quality setting.
60
==> use GIMP's native xcf format
61
where you need exactly the original.
69
GIMP_XJ_IMAGE ver:"1.0" w/h:256,256
70
L0 acl fsl pt o:35,116 n:"Pasted Layer"
71
L1 ln pt aml eml o:0,7 n:"Pasted Layer"
72
m1 smc o:0,7 n:"Pasted Layer mask"
74
c0 op:33.725 iv smc c:255,0,0 n:"saved selection mask"
77
TAR Contents of the example file
78
--------------------------------
80
-rw-r--r-- hof/users 228 Nov 1 11:19 1998 PRP
81
-rw-r--r-- hof/users 2352 Nov 1 11:19 1998 c0.jpg
82
-rw-r--r-- hof/users 3789 Nov 1 11:19 1998 l0.jpg
83
-rw-r--r-- hof/users 8569 Nov 1 11:19 1998 l1.jpg
84
-rw-r--r-- hof/users 9098 Nov 1 11:19 1998 l2.jpg
85
-rw-r--r-- hof/users 3926 Nov 1 11:19 1998 la0.jpg
86
-rw-r--r-- hof/users 6095 Nov 1 11:19 1998 la1.jpg
87
-rw-r--r-- hof/users 1623 Nov 1 11:19 1998 lm1.jpg
90
The example image has dimensions of 256x256 pixels.
91
The Image Type is RGB (default Property typ:0)
93
L0 The Image has a floating selection (stored as l0.jpg) at offset 35/116.
94
The floating selection has an alpha channel (stored in la0.jpg)
95
The floating selection is the active Layer.
97
There are 2 further Layers.
98
L1 at offset 077 is named "Pasted Layer" and is stored in l1.jpg.
99
This Layer has both an alpha channel (stored in la1.jpg)
100
and a LayerMask (stored in lm1.jpg)
102
(the Properties of the LayerMask are stored in an extra Line
103
of the PRP file beginning with m1)
105
l2 is the Background Layer without alpha channel. (stored in l2.jpg)
106
The Floating selection is attached to this layer ("fa" Property)
108
c0 The image has one extra channel named "saved selection mask"
109
This channel has full red color (c:255,0,0 property) and an opacity
110
value of 33.725 % but is invisible ("iv" property)
113
Syntax of the PRP -file
114
-----------------------
116
Image Properties (must be the 1. line in the PRP file)
120
GIMP_XJ_IMAGE Image-fileformat-Identifier
122
followed by a List of Image properties seperated by Blank:
129
PROP_GUIDES (can occure more than 1 time)
130
PROP_PARASITES (can occure more than 1 time)
135
l<nr> Layer description of layer <nr> without alpha channel.
136
the layers bitmapdata is stored in a jpeg encoded
138
L<nr> Layer description of layer <nr> with alpha channel.
139
the layers bitmapdata is stored in a jpeg encoded
140
file named l<nr>.jpg,
141
the alpha channel is stored in an additional jpeg encoded
142
file named la<nr>.jpg,
144
followed by a List of Layer properties seperated by Blank:
145
(properties for the default values are not written)
148
PROP_FLOATING_SELECTION
149
PROP_FLOATING_ATTACHED
154
PROP_PRESERVE_TRANSPARENCY
160
PROP_PARASITES (can occure more than 1 time)
167
c<nr> Channel description of channel <nr>.
168
the channels bitmapdata is stored in a jpeg encoded
170
m<nr> Layermask-channel of layer <nr>
171
the layermask-channels bitmapdata is tored in a jpeg encoded
174
followed by a List of Channel properties seperated by Blank:
175
(properties for the default values are not written)
179
PROP_FLOATING_ATTACHED
185
PROP_PARASITES (can occure more than 1 time)
191
p<nr> Parasite description of parasite <nr>.
192
the parasite data is stored 1:1 in a
195
followed by a List of Parasite properties seperated by Blank:
196
(properties for the default values are not written)
205
PATH Path identstring.
206
the parasite data is stored 1:1 in a
209
followed by a List of Path properties seperated by Blank:
210
(properties for the default values are not written)
219
--------------------------
221
--------------------------
225
--------------------------
231
mnemonic:int_value,int_value
233
mnemonic:int_value,int_value,int_value
237
mnemonic:float_value,float_value
239
mnemonic:float_value[,float_value ...]
241
xjt uses max 5 digits behind the comma.
242
precision of max 5 digits
243
17.00000999 is truncated to 17
244
2.00001999 is truncated to 2.00001
246
mnemonic:"string_value"
248
If a String contains DoublleQuote Backslash
249
or newline Characters, they are escaped by
250
a preceeding Backslash character.
254
hello "quotes" and \backslash
256
n:"hello \"quotes\" and \\backslash"
258
Properties are written as short mnemonics (1 upto 3 characters) to identify the Property.
259
Non-boolean Property-mnemonics require a Value seperated by ':'.
261
For each property there is a defined Defaultvalue. (usually 0, or "" for strings)
262
The Defaultvalue is assumed when the Token is not specified,
263
Boolean tokens default always to FALSE and become TRUE when specified.
267
/* property mnemonic type default values */
268
PROP_END, "*", PTYP_NOT_SUPPORTED, 0,
269
PROP_COLORMAP, "*", PTYP_NOT_SUPPORTED, 0,
270
PROP_ACTIVE_LAYER, "acl", PTYP_BOOLEAN, FALSE,
271
PROP_ACTIVE_CHANNEL, "acc", PTYP_BOOLEAN, FALSE,
272
PROP_SELECTION, "sel", PTYP_BOOLEAN, FALSE,
273
PROP_FLOATING_SELECTION, "fsl", PTYP_BOOLEAN, FALSE,
274
PROP_OPACITY, "op", PTYP_FLT, 100.0,
275
PROP_MODE, "md", PTYP_INT, 0,
276
PROP_VISIBLE, "iv", PTYP_BOOLEAN, FALSE,
277
PROP_LINKED, "ln", PTYP_BOOLEAN, FALSE,
278
PROP_PRESERVE_TRANSPARENCY, "pt", PTYP_BOOLEAN, FALSE,
279
PROP_APPLY_MASK, "aml", PTYP_BOOLEAN, FALSE,
280
PROP_EDIT_MASK, "eml", PTYP_BOOLEAN, FALSE,
281
PROP_SHOW_MASK, "sml", PTYP_BOOLEAN, FALSE,
282
PROP_SHOW_MASKED, "smc", PTYP_BOOLEAN, FALSE,
283
PROP_OFFSETS, "o", PTYP_2xINT, 0, 0,
284
PROP_COLOR, "c", PTYP_3xINT, 0, 0, 0,
285
PROP_COMPRESSION, "*", PTYP_NOT_SUPPORTED, 0,
286
PROP_GUIDES, "g", PTYP_2xINT, 0, 0,
287
PROP_RESOLUTION, "res", PTYP_2xFLT, 72.0, 72.0,
288
PROP_UNIT, "unt", PTYP_INT, 0, /* XJT_UNIT_PIXEL */
289
PROP_TATTOO, "tto", PTYP_INT, 0,
290
PROP_PARASITES, "pte", PTYP_INT, 0,
292
PROP_PARASITE_FLAGS, "ptf", PTYP_INT, 1, /* PARASITE_PERSISTENT */
293
PROP_FLOATING_ATTACHED, "fa", PTYP_BOOLEAN, FALSE,
294
PROP_NAME, "n", PTYP_STRING, "",
295
PROP_DIMENSION, "w/h", PTYP_2xINT, 0, 0,
296
PROP_TYPE, "typ", PTYP_INT, 0,
297
PROP_VERSION, "ver", PTYP_STRING, 0,
299
PROP_GIMP_VERSION, "gimp", PTYP_3xINT, 0,
300
PROP_PATH_POINT, "php", PTYP_FLIST, 0.0, 0.0, 0.0
301
PROP_PATH_TYPE, "pht", PTYP_INT, 1, /* XJT_BEZIER_PATH */
302
PROP_PATH_CURRENT, "pha", PTYP_BOOLEAN, FALSE,
303
PROP_PATH_LOCKED, "phl", PTYP_BOOLEAN, FALSE,
306
Property Values (Valid Ranges)
307
------------------------------
309
PROP_OPACITY valid values are
310
0.0 (full transparent)
314
PROP_TYPE valid values are:
318
PROP_MODE valid values are:
319
0 ... XJT_NORMAL_MODE
320
1 ... XJT_DISSOLVE_MODE
321
2 ... XJT_BEHIND_MODE
322
3 ... XJT_MULTIPLY_MODE
323
4 ... XJT_SCREEN_MODE
324
5 ... XJT_OVERLAY_MODE
325
6 ... XJT_DIFFERENCE_MODE
326
7 ... XJT_ADDITION_MODE
327
8 ... XJT_SUBTRACT_MODE
328
9 ... XJT_DARKEN_ONLY_MODE
329
10 ... XJT_LIGHTEN_ONLY_MODE
331
12 ... XJT_SATURATION_MODE
332
13 ... XJT_COLOR_MODE
333
14 ... XJT_VALUE_MODE
334
15 ... XJT_DIVIDE_MODE
337
valid values for the 1.st integer are
338
positve integers, representing x or y
339
position (depends on the 2.nd value)
340
valid values for the 2.nd integer are:
341
0 ... XJT_ORIENTATION_HORIZONTAL
342
1 ... XJT_ORIENTATION_VERTICAL
345
in older xjt files (older than xjt version 1.1.15)
346
there was no exact specification and the gimp internal
347
representation of the guide orientation was written
348
to the xjt guide orientation property.
349
Unforunately this gimp internal representation has changed
351
PROP_PATH_TYPE valid values are:
352
1 ... XJT_BEZIER_PATH
356
This property is a list of float values.
357
For Paths of the type XJT_BEZIER_PATH
358
each point is represented by a float value triplet
361
where type can be 1 (BEZIER_ANCHOR point)
362
or 2 (BEZIER_CONTROL point)
364
PROP_UNIT valid values are:
373
-------------------------------
374
Extended Example of PRP file:
375
-------------------------------
377
PARASITES: The parasite data is stored in a seperate file for each
378
parasite. The file is named p<id>.pte, where
379
<id> is a unique integer parasite Id.
382
A Layer, Channel or Image can have 0 or more PROP_PARASITE
383
Properties (pte:1 pte:2 ...), where the integer parameter
384
refers to the unique parasite id.
386
Example of PRP file with resolution, parasites and paths:
387
-------------------------------------------------------------
388
GIMP_XJ_IMAGE ver:"1.1" w/h:256,256 res:72.0,100.5 pte:1
389
PATH n:"Path 1" php:103,65,1,103,65,2,176,15,2,177,15,1,178,15,2,198,229,2,198,229,1,198,229,2
390
L0 acl fsl pt o:35,116 n:"Pasted Layer"
391
L1 ln pt aml eml o:0,7 n:"Pasted Layer" pte:2 pte:3
392
m1 smc o:0,7 n:"Pasted Layer mask"
394
c0 op:33.725 iv smc c:255,0,0 n:"saved selection mask" pte:4
395
p1 n:"image parasite"
396
p2 n:"layer parasite A"
397
p3 n:"layer parasite B"
398
p4 n:"channel parasite"
400
TAR Contents of the example file
401
--------------------------------
402
>tar -tvf example.xjt
403
-rw-r--r-- hof/users 228 Nov 1 11:19 1998 PRP
404
-rw-r--r-- hof/users 2352 Nov 1 11:19 1998 c0.jpg
405
-rw-r--r-- hof/users 3789 Nov 1 11:19 1998 l0.jpg
406
-rw-r--r-- hof/users 8569 Nov 1 11:19 1998 l1.jpg
407
-rw-r--r-- hof/users 9098 Nov 1 11:19 1998 l2.jpg
408
-rw-r--r-- hof/users 3926 Nov 1 11:19 1998 la0.jpg
409
-rw-r--r-- hof/users 6095 Nov 1 11:19 1998 la1.jpg
410
-rw-r--r-- hof/users 1623 Nov 1 11:19 1998 lm1.jpg