RW2 File Documentation
Summary
An .rw2 file is a Panasonic Lumix RAW image — unprocessed sensor data, a digital negative straight off a Panasonic Lumix camera, not a finished picture. Its MIME type is image/x-panasonic-rw2. On Windows, install the free Raw Image Extension to see thumbnails. Edit it non-destructively in darktable, RawTherapee or Lightroom, then convert to JPG to share or to DNG to archive.
Technical details
| Full name | Panasonic Lumix RAW Image, version 2 |
|---|---|
| File extension | .rw2 |
| MIME type | image/x-panasonic-rw2 |
| Format type | TIFF/EP-based proprietary camera raw |
| Category | Camera raw files |
| Developer | Panasonic — Lumix (also used by some Leica bodies) |
| Introduced | Circa 2008, replacing the earlier Panasonic .raw |
| Byte order | Little-endian (“II”, Intel) |
| Container / base format | TIFF/EP with a Panasonic-specific header |
| Magic number | Hex 49 49 55 00 (“IIU\0”) at offset 0 |
| Bit depth | 12-bit or 14-bit sensor data, typical |
| Embedded preview | JPEG thumbnail and full-size preview |
| Metadata | EXIF plus Panasonic MakerNote |
| Open standard | No — proprietary |
| Related extensions | .rwl .raw .dng .tiff .jpg |
| Specification | libopenraw — RW2 format notes |
What is an RW2 file?
RW2 is the raw image format Panasonic writes in its Lumix digital cameras. It arrived around 2008 and replaced the earlier Panasonic .raw format. A raw file holds the data read off the image sensor before the camera turns it into a picture, which is why photographers call it a digital negative.
The difference from a JPEG is the point of the format. When a camera saves a JPEG, it demosaics the sensor data, applies white balance, sharpens, sets contrast and colour, then compresses the result and throws the rest away. An RW2 skips all of that. The sensor readout is stored close to untouched, so the full tonal range and exposure latitude survive. That is what lets you recover a blown highlight or lift a shadow later. The trade-off is size and effort: RW2 files are large, and they need software to “develop” them before they look like a normal photo.
Raw sensor data: the Bayer mosaic and demosaicing
A camera sensor does not see colour. Each photosite records brightness only. To capture colour, the sensor is overlaid with a colour filter array, and on Lumix bodies this is a Bayer CFA: a repeating pattern of red, green and blue filters with twice as many green cells as red or blue, matching the eye’s sensitivity. Every pixel in the raw file therefore knows one colour channel and nothing about the other two.
Turning that single-channel mosaic into a full-colour RGB image is called demosaicing. The raw developer looks at each pixel’s neighbours and interpolates the two missing channels. Because this happens on your computer rather than in the camera, you choose the demosaicing algorithm, the white balance and the colour rendering, and you can change your mind without ever degrading the file. This is the core reason raw editing is non-destructive: the original RW2 is preserved, and every adjustment lives in a separate sidecar or catalogue.
The Panasonic TIFF/EP structure and the modified magic
Internally, RW2 follows the TIFF/EP raw layout, the same directory-of-tags model that underpins ordinary TIFF files and Adobe DNG. What sets it apart is the file header. A standard TIFF begins with 49 49 2A 00 (“II*\0”) or its big-endian twin. RW2 keeps the II little-endian marker but swaps the third byte, so the file opens with 49 49 55 00 — the ASCII string “IIU” followed by a null.
Offset Bytes Meaning
0 49 49 "II" -> little-endian (Intel) byte order
2 55 00 0x55 version marker (TIFF uses 0x2A here)
4 08 00 00 00 offset to first IFD (little-endian uint32)
...
[IFD] count (uint16) number of directory entries
entry[0] 12 bytes: tag + type + count + value/offset
entry[1] 12 bytes ...
...
next-IFD offset (uint32, 0 if none)
That one byte, 0x55 where TIFF expects 0x2A, is what tells a parser it is looking at Panasonic RW2 and not a generic TIFF. A tool that blindly trusts the II prefix and assumes standard TIFF will misread the file; correct decoders check the version byte first. Documentation of this quirk is available from the libopenraw project.
Inside the IFD: tags, SubIFDs and the MakerNote
After the four-byte header comes a four-byte little-endian offset pointing to the first Image File Directory, or IFD. An IFD begins with a two-byte count of how many entries follow, and each entry is exactly twelve bytes: a tag number (uint16) that says what the field is, a type (uint16) that says whether the value is a byte, short, long, rational and so on, a count (uint32) of how many values there are, and a final four bytes holding either the value itself or an offset to where the value lives elsewhere in the file.
These entries are the file’s table of contents. Some tags describe the image geometry and record where the raw pixel strip sits. Others point to SubIFDs, nested directories that hold the full-resolution sensor image separately from smaller previews. One entry is the MakerNote, a vendor block where Panasonic stores its own fields: the specific camera and lens, exposure settings, the as-shot white balance, and the parameters a developer needs to interpret this particular body’s output. Standard EXIF metadata (date, ISO, aperture, shutter, and sometimes GPS coordinates) lives alongside it. That metadata travels with the file, so if privacy matters, strip EXIF and GPS before publishing.
The embedded JPEG preview
Raw data on its own is slow to display, because every viewer would have to demosaic the whole frame just to draw a thumbnail. To avoid that, an RW2 carries one or more embedded JPEG previews: a small thumbnail and often a larger, camera-rendered preview. This is what file browsers and the back of the camera actually show. It is also why a fresh RW2 can look punchy on screen and then appear flat when you first open it in a raw developer — the preview is the camera’s baked-in JPEG rendering, while the developer starts from the neutral sensor data and asks you to make those decisions yourself.
Per-model variants and camera profiles
RW2 is not one fixed layout. Each Lumix body writes a slightly different variant: sensor dimensions, black and white levels, the exact CFA arrangement and compression details all shift from model to model. Raw software cannot decode a body it has never seen without a matching camera profile that describes those specifics. This is why a new Lumix camera often will not open in older versions of darktable, RawTherapee or Lightroom until the software is updated. The format is stable; the per-model calibration data is what has to keep catching up.
RW2 and the Leica RWL sibling
Several Leica cameras are built on Panasonic sensors and image pipelines, and they write a closely related raw format under the extension .rwl. Structurally RWL is essentially RW2 with a different name on the door. Most raw software treats the two the same and decodes RWL through the same code path as RW2, so if a tool reads your Lumix files it will usually read the Leica ones too.
DNG as an open archival target
Because RW2 is proprietary and changes with every new body, long-term access depends on your software continuing to support it. Converting to DNG, Adobe’s openly documented raw container, is the common archival hedge. DNG keeps the actual raw sensor data intact while shedding Panasonic’s proprietary wrapper for a published, TIFF/EP-based structure that far more tools understand. The free Adobe DNG Converter does this conversion, and can embed the original RW2 inside the DNG if you want a reversible copy. For day-to-day editing you open the RW2 (or DNG) in a raw developer such as darktable, RawTherapee, SilkyPix, or Lightroom / Camera Raw, adjust non-destructively, and export a JPEG, TIFF or PSD to share. On Windows the free Raw Image Extension from the Microsoft Store adds thumbnail and preview support; macOS Photos and Preview read Panasonic raw natively.
FAQ
Why does RW2 use 0x55 where TIFF uses 0x2A?
The header byte at offset 2 is TIFF’s version marker. Panasonic reuses the TIFF/EP structure but sets that byte to 0x55 (‘U’) instead of the standard 0x2A (‘*’). The change lets software recognise the file as Panasonic RW2 rather than a plain TIFF while still benefiting from the familiar little-endian IFD layout.
What is demosaicing and why does raw need it?
Each sensor pixel records only one colour, filtered through a Bayer CFA. Demosaicing interpolates the two missing colour channels at every pixel to reconstruct a full RGB image. A raw file stores the mosaic un-interpolated, so demosaicing has to happen before it can be viewed as a normal photo.
What is the difference between RW2 and RWL?
RW2 is Panasonic’s Lumix raw format; RWL is the near-identical format written by Leica cameras that use Panasonic sensors. The internal structure is essentially the same, and most software decodes both with shared code.
Why do new Lumix cameras need updated raw software?
Every Lumix body produces a slightly different RW2 variant. A raw developer needs a camera profile for that specific model to read its sensor data correctly, so support for a brand-new camera usually arrives in a software update rather than working on day one.
References
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.