2003-11-06 21:01:39 +08:00
|
|
|
The GIMP Paintbrush File Format Version 1 (.gbr)
|
|
|
|
------------------------------------------------
|
|
|
|
|
|
|
|
Based on examples and code, it seems that v1 is like v2, but it is
|
|
|
|
lacking bytes 20 - 27 (no magic or spacing info), and thus having
|
|
|
|
as last header field:
|
|
|
|
|
2009-06-20 18:46:42 +08:00
|
|
|
Bytes 20 - (header_size - 1):
|
2003-11-06 21:01:39 +08:00
|
|
|
Type: char *
|
|
|
|
Value: undefined encoding string - name of brush
|
|
|
|
|
|
|
|
GBR v1 is deprecated and should never be used to save new brushes.
|
|
|
|
|
|
|
|
|
2003-07-10 03:15:27 +08:00
|
|
|
|
|
|
|
The GIMP Paintbrush File Format Version 2 (.gbr)
|
|
|
|
------------------------------------------------
|
|
|
|
|
|
|
|
HEADER
|
|
|
|
------
|
|
|
|
|
|
|
|
Bytes 0 - 3: header_size:
|
|
|
|
Type: 32 bit unsigned int
|
|
|
|
Value: size of brush header (28) + length of brush name
|
|
|
|
|
|
|
|
Bytes 4 - 7: version
|
|
|
|
Type: 32 bit unsigned int
|
2009-06-20 18:46:42 +08:00
|
|
|
Value: The file format version.
|
2003-07-10 03:15:27 +08:00
|
|
|
|
|
|
|
Bytes 8 - 11: width
|
|
|
|
Type: 32 bit unsigned int
|
|
|
|
Value: Brush width
|
|
|
|
|
|
|
|
Bytes 12 - 15: height
|
|
|
|
Type: 32 bit unsigned int
|
|
|
|
Value: Brush height
|
|
|
|
|
|
|
|
Bytes 16 - 19: bytes
|
|
|
|
Type: 32 bit unsigned int
|
|
|
|
Value: Colour depth of brush.
|
|
|
|
1 = greyscale, 4 = RGBA
|
|
|
|
|
|
|
|
Bytes 20 - 23: magic_number
|
|
|
|
Type: 32 bit unsigned int
|
2009-06-20 02:44:49 +08:00
|
|
|
Value: GIMP brush magic number.
|
2003-07-10 03:15:27 +08:00
|
|
|
('G' << 24) + ('I' << 16) + ('M' << 8) + 'P'
|
|
|
|
|
|
|
|
Bytes 24 - 27: spacing
|
|
|
|
Type: 32 bit unsigned int
|
|
|
|
Value: Default spacing to be used for brush. Percentage
|
|
|
|
of brush width.
|
|
|
|
|
2009-06-20 02:44:49 +08:00
|
|
|
Bytes 28 - (header_size - 1):
|
2003-07-10 03:15:27 +08:00
|
|
|
Type: char *
|
|
|
|
Value: UTF-8 string - name of brush
|
|
|
|
|
|
|
|
|
|
|
|
BODY
|
|
|
|
----
|
|
|
|
Size: width * height * bytes
|
|
|
|
Type: uchar *
|
|
|
|
Value: Pixel values (row-first) for brush
|
|
|
|
|
2003-09-04 00:59:22 +08:00
|
|
|
|
|
|
|
|
2003-11-06 21:01:39 +08:00
|
|
|
The GIMP Paintbrush File Format Version 3 (.gbr)
|
2003-09-04 00:59:22 +08:00
|
|
|
------------------------------------------------
|
|
|
|
|
2003-11-06 21:01:39 +08:00
|
|
|
This changed GIMP brush format was introduced by the FilmGimp or
|
2009-06-20 18:46:42 +08:00
|
|
|
CinePaint developers without notifying the GIMP developers. We've
|
|
|
|
added support for reading these brushes. The format is very similar
|
|
|
|
to version 2 but uses the bytes field as a data format identifier.
|
|
|
|
It seems the only format identifier in use is 18 which corresponds
|
|
|
|
to 16bit floats. If you encounter brushes with a different data
|
|
|
|
format, please let the GIMP developers know.
|