~ubuntu-branches/ubuntu/maverick/gimp/maverick-updates

« back to all changes in this revision

Viewing changes to plug-ins/xjt/README_xjt_fileformat.txt

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2005-12-09 19:44:52 UTC
  • Revision ID: james.westby@ubuntu.com-20051209194452-yggpemjlofpjqyf4
Tags: upstream-2.2.9
ImportĀ upstreamĀ versionĀ 2.2.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
------------------------------ 
 
2
XJT Fileformat specification:   
 
3
------------------------------
 
4
 
 
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)
 
9
 
 
10
   XJT Fileformat was designed to save compressed GIMP Images with
 
11
   all the properties that are available in GIMP.
 
12
 
 
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)
 
16
 
 
17
   Additional property informations about offsets, opacity, layernames etc..
 
18
   are stored in the readable textfile called "PRP" (Properties)
 
19
 
 
20
   The resulting tar-file is optionaly compressed a 2.nd time
 
21
   using GZIP or BZIP2.
 
22
   (depends on the filename ending "gz" or "bz2")
 
23
 
 
24
   Filename Extensions are:
 
25
     image.xjt                # plain tar file
 
26
     image.xjtgz              # gzip compressed tar file
 
27
     image.xjbz2              # bzip2 compressed tar file
 
28
     
 
29
Restrictions:
 
30
-------------
 
31
   ** XJT does not support INDEXED Images. **
 
32
   
 
33
 
 
34
 
 
35
 
 
36
Why should anyone use the new XJT Fileformat ?
 
37
---------------------------------------------
 
38
 
 
39
   XJT Advantages:
 
40
 
 
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 )
 
45
     
 
46
   - Saved image keeps all layers channels and properties
 
47
   
 
48
   - single Layers can be extracted using tar
 
49
     and then be accessed by many other 
 
50
     jpeg-compatible programs.
 
51
 
 
52
 
 
53
   XJT Disadvantages:
 
54
   
 
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.
 
59
     
 
60
     ==> use GIMP's native xcf format
 
61
         where you need exactly the original.
 
62
 
 
63
 
 
64
Example:
 
65
________
 
66
 
 
67
    Example of PRP file:
 
68
    --------------------
 
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"
 
73
       l2 fa n:"Background"
 
74
       c0 op:33.725 iv smc c:255,0,0 n:"saved selection mask"
 
75
 
 
76
 
 
77
    TAR Contents of the example file
 
78
    --------------------------------
 
79
      >tar -tvf example.xjt
 
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
 
88
 
 
89
 
 
90
  The example image has dimensions of 256x256 pixels. 
 
91
  The Image Type is RGB (default Property typ:0)
 
92
  
 
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.
 
96
 
 
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)
 
101
     
 
102
     (the Properties of the LayerMask are stored in an extra Line
 
103
     of the PRP file beginning with m1)
 
104
     
 
105
  l2 is the Background Layer without alpha channel. (stored in l2.jpg)
 
106
     The Floating selection is attached to this layer ("fa" Property)
 
107
  
 
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)
 
111
 
 
112
 
 
113
Syntax of the PRP -file
 
114
-----------------------
 
115
 
 
116
  Image Properties (must be the 1. line in the PRP file)
 
117
  ================
 
118
 
 
119
       The line starts with 
 
120
       GIMP_XJ_IMAGE Image-fileformat-Identifier
 
121
 
 
122
       followed by a List of Image properties seperated by Blank:
 
123
          PROP_VERSION
 
124
          PROP_GIMP_VERSION
 
125
          PROP_DIMENSION
 
126
          PROP_RESOLUTION
 
127
          PROP_UNIT
 
128
          PROP_TYPE
 
129
          PROP_GUIDES        (can occure more than 1 time)
 
130
          PROP_PARASITES     (can occure more than 1 time)
 
131
 
 
132
  Layer Properties:
 
133
  =================
 
134
      The line starts with
 
135
       l<nr>     Layer description of layer <nr> without alpha channel.
 
136
                     the layers bitmapdata is stored in a jpeg encoded
 
137
                     file named l<nr>.jpg
 
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,
 
143
 
 
144
       followed by a List of Layer properties seperated by Blank:
 
145
       (properties for the default values are not written)
 
146
 
 
147
           PROP_ACTIVE_LAYER
 
148
           PROP_FLOATING_SELECTION
 
149
           PROP_FLOATING_ATTACHED
 
150
           PROP_OPACITY
 
151
           PROP_MODE
 
152
           PROP_VISIBLE
 
153
           PROP_LINKED
 
154
           PROP_PRESERVE_TRANSPARENCY
 
155
           PROP_APPLY_MASK
 
156
           PROP_EDIT_MASK
 
157
           PROP_SHOW_MASK
 
158
           PROP_OFFSETS
 
159
           PROP_TATTOO
 
160
           PROP_PARASITES   (can occure more than 1 time)
 
161
           PROP_NAME
 
162
 
 
163
  Channel Properties:
 
164
  ===================
 
165
      
 
166
      The line starts with
 
167
       c<nr>     Channel description of channel <nr>.
 
168
                     the channels bitmapdata is stored in a jpeg encoded
 
169
                     file named c<nr>.jpg
 
170
       m<nr>     Layermask-channel of layer <nr>
 
171
                     the layermask-channels bitmapdata is tored in a jpeg encoded
 
172
                     file named c<nr>.jpg
 
173
      
 
174
       followed by a List of Channel properties seperated by Blank:
 
175
       (properties for the default values are not written)
 
176
 
 
177
          PROP_ACTIVE_CHANNEL
 
178
          PROP_SELECTION
 
179
          PROP_FLOATING_ATTACHED
 
180
          PROP_OPACITY
 
181
          PROP_VISIBLE
 
182
          PROP_SHOW_MASKED
 
183
          PROP_COLOR
 
184
          PROP_TATTOO
 
185
          PROP_PARASITES   (can occure more than 1 time)
 
186
          PROP_NAME
 
187
 
 
188
  Parasite Properties:
 
189
  ====================
 
190
      The line starts with
 
191
       p<nr>     Parasite description of parasite <nr>.
 
192
                     the parasite data is stored 1:1 in a
 
193
                     file named p<nr>.pte
 
194
 
 
195
       followed by a List of Parasite properties seperated by Blank:
 
196
       (properties for the default values are not written)
 
197
 
 
198
           PROP_NAME
 
199
           PROP_PARASITE_FLAGS
 
200
            
 
201
 
 
202
  Path Properties:
 
203
  ====================
 
204
      The line starts with
 
205
       PATH    Path identstring.
 
206
                     the parasite data is stored 1:1 in a
 
207
                     file named p<nr>.pte
 
208
 
 
209
       followed by a List of Path properties seperated by Blank:
 
210
       (properties for the default values are not written)
 
211
 
 
212
           PROP_NAME
 
213
           PROP_PATH_TYPE
 
214
           PROP_PATH_CURRENT
 
215
           PROP_PATH_LOCKED
 
216
           PROP_TATTOO
 
217
           PROP_PATH_POINT
 
218
 
 
219
--------------------------
 
220
Properties Summary
 
221
--------------------------
 
222
 
 
223
 
 
224
Property types:
 
225
--------------------------
 
226
  PTYP_BOOLEAN
 
227
         mnemonic
 
228
  PTYP_INT
 
229
         mnemonic:int_value
 
230
  PTYP_2xINT
 
231
         mnemonic:int_value,int_value
 
232
  PTYP_3xINT
 
233
         mnemonic:int_value,int_value,int_value
 
234
  PTYP_FLT
 
235
         mnemonic:float_value
 
236
  PTYP_2xFLT
 
237
         mnemonic:float_value,float_value
 
238
  PTYP_FLIST
 
239
         mnemonic:float_value[,float_value ...]
 
240
                 
 
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
 
245
  PTYP_STRING
 
246
         mnemonic:"string_value"
 
247
         
 
248
         If a String contains DoublleQuote Backslash
 
249
         or newline Characters, they are escaped by
 
250
         a preceeding Backslash character.
 
251
         
 
252
         Example:
 
253
            the text: 
 
254
               hello "quotes" and \backslash
 
255
            is encoded as:
 
256
               n:"hello \"quotes\" and \\backslash"
 
257
 
 
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 ':'. 
 
260
 
 
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.
 
264
 
 
265
 
 
266
 
 
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,
 
291
 
 
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,
 
298
 
 
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, 
 
304
 
 
305
 
 
306
Property Values (Valid Ranges)
 
307
------------------------------
 
308
 
 
309
PROP_OPACITY  valid values are 
 
310
              0.0        (full transparent)
 
311
                upto 
 
312
              100.0      (full opaque)
 
313
              
 
314
PROP_TYPE     valid values are:
 
315
              0 ... XJT_RGB 
 
316
              1 ... XJT_GRAY
 
317
 
 
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
 
330
              11 ...  XJT_HUE_MODE
 
331
              12 ...  XJT_SATURATION_MODE
 
332
              13 ...  XJT_COLOR_MODE
 
333
              14 ...  XJT_VALUE_MODE
 
334
              15 ...  XJT_DIVIDE_MODE
 
335
 
 
336
PROP_GUIDES
 
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
 
343
              
 
344
    Note: 
 
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
 
350
 
 
351
PROP_PATH_TYPE  valid values are:
 
352
              1 ...  XJT_BEZIER_PATH
 
353
              
 
354
   
 
355
PROP_PATH_POINT
 
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
 
359
     x,y,type
 
360
     
 
361
     where type can be 1  (BEZIER_ANCHOR point)
 
362
                    or 2  (BEZIER_CONTROL point)
 
363
 
 
364
PROP_UNIT    valid values are:
 
365
    0 ... XJT_UNIT_PIXEL
 
366
    1 ... XJT_UNIT_INCH
 
367
    2 ... XJT_UNIT_MM
 
368
    3 ... XJT_UNIT_POINT
 
369
    4 ... XJT_UNIT_PICA
 
370
 
 
371
 
 
372
 
 
373
-------------------------------
 
374
Extended Example of PRP file:
 
375
-------------------------------
 
376
 
 
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.
 
380
             
 
381
 
 
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.
 
385
   
 
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"
 
393
       l2 fa n:"Background"
 
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"
 
399
 
 
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
 
411
                                                       p1.pte  
 
412
                                                       p2.pte
 
413
                                                       p3.pte
 
414
                                                       p4.pte
 
415