PAT File Documentation


Summary

A Pattern File (.pat) is an ambiguous extension. Most often it is a tileable image pattern for Adobe Photoshop or GIMP — a small seamless bitmap you install and use as a fill. It is also an AutoCAD hatch pattern (plain-text line definitions), and some embroidery machines reuse it for stitch data. You do not open an image pattern as a document; you install it into the app’s Patterns. To identify one, check which program it came from, since the formats are not interchangeable.

Technical details

FeatureValue
Full namePattern File (Photoshop/GIMP image pattern; also AutoCAD hatch)
File extension.pat
MIME typeapplication/octet-stream (image pattern); text/plain (AutoCAD hatch)
Format typeTileable bitmap preset (binary), or text hatch definition
AmbiguousYes — meaning depends on the creating program
Photoshop .patAdobe private binary preset (undocumented); tagged near 8BPT
GIMP .patOpen binary format; ASCII tag GPAT at offset 20
AutoCAD .patPlain-text hatch: *name then angle/spacing/dash lines
DeveloperAdobe (Photoshop); The GIMP Team; Autodesk (hatch)
Typical tile size8×8 up to 256×256 pixels (image patterns)
Cross-compatibleNo — a GIMP .pat will not load in Photoshop, and vice versa
Used asA fill / background, not a standalone image
Open standardPartial (GIMP documented; Photoshop proprietary)
Export toPNG / JPG (extract the tile as an image)
Related extensions.abr, .grd, .asl, .gih, .png
GIMP specdeveloper.gimp.org/core/standards/pat/
File signature (magic bytes) — GIMP pattern
.. .. .. .. 47 50 41 54

A GIMP .pat is binary with the ASCII tag GPAT (47 50 41 54) at byte offset 20, after a fixed header (header size, version, width, height and colour depth as big-endian integers), followed by the UTF-8 pattern name and then raw uncompressed pixels. A Photoshop .pat is a different, undocumented Adobe binary preset (tagged near 8BPT) with no published signature, and an AutoCAD hatch .pat is plain text with no signature at all — it opens in Notepad and starts with a line beginning * and the pattern name.

What is a PAT file?

A .pat file is a “pattern” file, and the extension is genuinely ambiguous: several unrelated programs use it for different things. The most common meaning by far is a tileable image pattern for an image editor — a small seamless bitmap (a texture, paper, or repeating motif) used to fill an area or background in Adobe Photoshop or GIMP. The same extension is also used by AutoCAD for a hatch pattern, which is a plain-text definition of repeating lines used to fill regions in CAD drawings, and a few embroidery and sewing systems reuse .pat for stitch-pattern data. These formats have nothing in common except the three letters, so the first practical step is always to work out which program produced the file.

This article leads with the image-pattern meaning, since that is what most people who download a .pat are dealing with, then covers the AutoCAD hatch format separately. The key point up front: you do not open an image pattern as a document. You install it into the program’s presets and then use it as a fill.

The GIMP .pat format: the GPAT header

GIMP’s pattern format is open and documented, which makes it the clearest of the three to describe at the byte level. A GIMP .pat is binary: a fixed header of big-endian integers, then a name, then raw pixel data for the tile.

offset 0   uint32  header_size   (bytes before the pixel data)
offset 4   uint32  version       (currently 1)
offset 8   uint32  width         (tile width in pixels)
offset 12  uint32  height        (tile height in pixels)
offset 16  uint32  bytes/pixel   (1=grey, 2=grey+alpha, 3=RGB, 4=RGBA)
offset 20  char[4] "GPAT"        (magic tag)
offset 24  char[]  name          (UTF-8, header_size - 24 bytes)
...        raw uncompressed pixel data, width*height*bpp bytes

The ASCII tag GPAT at offset 20 is the reliable signature. The four integers before it give the tile’s dimensions and colour depth, and the bytes/pixel field encodes the colour mode: 1 for greyscale, 3 for RGB, and the even values add an alpha channel. After the tag comes a UTF-8 pattern name whose length is header_size − 24, and then the pixels themselves, stored uncompressed in row order. Because the pixel data is raw, a GIMP pattern file’s size is essentially width × height × bytes-per-pixel plus the small header.

The Photoshop .pat format and why the two do not mix

Adobe’s .pat is a private, undocumented binary preset (its internal pattern data is tagged near the string 8BPT). A single Photoshop .pat can hold several named patterns at once, which is why a downloaded pack often installs many fills from one file. Because Adobe has never published the layout, GIMP cannot read a Photoshop .pat without a conversion plugin, and Photoshop cannot read a GIMP .pat at all. This is the single most common “my .pat is broken” problem: the file is fine, it is just the wrong app’s format. The reliable cross-application route is not to convert the preset but to export the tile as an ordinary PNG and use that image, which any editor can define as a new pattern.

Installing and using an image pattern

Using an image pattern is install-then-fill, and the steps differ by editor. In Photoshop, open Window › Patterns (or Edit › Presets › Preset Manager), choose Import/Load Patterns from the panel menu, and select the .pat; the patterns then appear as fills under Edit › Fill › Pattern. In GIMP, copy the .pat into the patterns folder (its path is under Edit › Preferences › Folders › Patterns), click the refresh button in the Patterns dialog, and pick the new tile. GIMP is a capable free stand-in when you have a Photoshop pattern you cannot open directly — though, as above, a Photoshop .pat may still need conversion or a PNG export first.

Turning a pattern into a plain image

Since an image pattern is just a small bitmap, “converting” a .pat really means extracting that tile as a normal image. In GIMP, load the pattern and use File › Export As to write a PNG (which keeps transparency) or a JPG (flat, lossy, no transparency). A Photoshop .pat can contain several patterns, so the practical method is to fill a canvas with each pattern in turn and save them out individually. There is no meaningful conversion from a pattern to a Photoshop brush (.abr): a fill and a brush are different tools, so you would define a new brush from the exported image rather than transcode the file.

The other .pat: AutoCAD hatch patterns

An AutoCAD hatch .pat is a completely different, plain-text format — it opens in Notepad. Each pattern is a header line beginning with an asterisk and the pattern name, followed by one or more line-definition rows that describe a family of parallel lines by angle, origin, offset, and an optional dash pattern.

*BRICK, Standard brick pattern
0,    0,0,    0,0.25
90,   0,0,    0,0.5,   0.25,-0.25

Each definition line reads as: angle, x-origin, y-origin, delta-x (shift between successive lines in the family), delta-y (spacing between lines), then optional dash lengths (positive for a dash, negative for a gap). AutoCAD tiles these line families across a region to produce the fill. You install one by placing the .pat in a folder on AutoCAD’s support-file search path and selecting the pattern in the Hatch command. This format shares only its extension with the Photoshop/GIMP image pattern; a CAD hatch .pat will not load into an image editor, and an image pattern is meaningless to AutoCAD.

Frequently asked questions

How do I open a PAT file?

If it is an image pattern, you install it rather than open it: in Photoshop, load it via Window › Patterns; in GIMP, drop it into the patterns folder and refresh, then pick it from the Patterns dialog. If it is an AutoCAD hatch .pat, it is plain text you can read in Notepad and install into AutoCAD’s hatch library.

Can I use a Photoshop .pat in GIMP?

Not directly — they are different formats. GIMP can import some Photoshop patterns through a plugin, and a GIMP .pat will not load in Photoshop at all. The reliable route is to export the pattern tile as a PNG and define that image as a pattern in the other app.

How do I turn a .pat into a PNG?

Load the pattern in GIMP or Photoshop and export the tile: in GIMP, select the pattern and use File › Export As. A Photoshop .pat can hold several patterns, so fill a canvas with each and save them individually.

References