Skip to content

Image File Format and Integrity Checks

Structural analysis of image containers such as JPEG, PNG, and TIFF can reveal inconsistencies introduced by post-capture editing or format conversion. This topic covers how examiners inspect file headers, chunk structures, and embedded data to detect signs of tampering.

Last updated:

Share

Every digital image file is a container: a structured sequence of bytes that declares its format, encodes pixel data, and stores ancillary information such as camera settings, timestamps, and software history. Image file format integrity checks examine that structure to determine whether the file is consistent with an unmodified original or whether it shows evidence of re-saving, format conversion, or deliberate alteration. Examiners inspect file headers, internal segment or chunk sequences, embedded metadata blocks, and the relationship between declared properties and actual file content. A JPEG whose quantisation tables do not match those of the camera model named in its EXIF header, or a PNG containing a chunk type never produced by any camera firmware, carries structural evidence of post-capture intervention.

Format-level analysis is the first structural layer of image authentication. It does not require access to the original capture device and can be applied to any file in the examiner's possession. The analysis complements pixel-level techniques such as noise inconsistency checks and copy-move detection by providing a different class of evidence: not what the image shows, but how the file was written. Courts in the United States, the United Kingdom, the European Union, and India all treat file provenance evidence as relevant to authenticity; the Bharatiya Sakshya Adhiniyam 2023 (which replaced the Indian Evidence Act 1872) retains the requirement that electronically produced evidence be shown to have been produced by a computer operating properly and without opportunity for tampering, making format integrity documentation directly relevant to admissibility.

Three image formats account for the vast majority of forensic casework: JPEG (used by nearly all consumer cameras and smartphones), PNG (common in screenshots, edited images, and web graphics), and TIFF (used in professional and law-enforcement imaging workflows). Each format has a distinct internal structure, and each leaves a characteristic signature when it is re-encoded, converted, or modified. Understanding those signatures allows an examiner to reconstruct part of an image's processing history from the file itself, before any pixel-level analysis begins.

By the end of this topic you will be able to:

  • Describe the internal structure of JPEG, PNG, and TIFF files and identify the segments or chunks that carry integrity-relevant information.
  • Explain how JPEG double-compression and quantisation table analysis detect re-saving outside the original capture device.
  • Identify anomalous PNG chunk types, sequences, and CRC mismatches that indicate post-capture modification.
  • Interpret EXIF and XMP metadata fields as provenance claims and test their consistency against the file's structural properties.
  • Apply format integrity findings within a broader authentication report, describing what the evidence establishes and what it does not.
Key terms
File signature (magic bytes)
The fixed byte sequence at the start of a file that identifies its format. JPEG files begin with FF D8 FF; PNG files begin with 89 50 4E 47 0D 0A 1A 0A. A file whose extension does not match its magic bytes has been mislabelled, which itself requires explanation.
JPEG quantisation table
A matrix of 64 values embedded in a JPEG file that controls the precision with which each frequency component of the image is encoded. Camera manufacturers and software applications use distinct quantisation table sets; matching a file's tables against a known-camera database is a core technique for identifying the encoding device or application.
PNG chunk
The basic structural unit of a PNG file. Each chunk has a four-character type code, a length field, a data payload, and a CRC-32 checksum. Critical chunks (IHDR, IDAT, IEND) must be present and in a defined order; ancillary chunks are optional. Unexpected or malformed chunks indicate post-processing.
EXIF (Exchangeable Image File Format)
A metadata standard embedded in JPEG and TIFF files by capture devices. EXIF fields record camera make and model, lens data, exposure parameters, GPS location, and a modification timestamp. EXIF is writable by editing software, so its contents are a provenance claim to be verified, not a trusted record.
XMP (Extensible Metadata Platform)
An Adobe-defined metadata format stored as an XML packet embedded in image files. XMP carries a software history field (xmpMM:History) that editing applications append to when they process a file. A populated XMP history block is direct structural evidence of post-capture software processing.
Thumbnail inconsistency
Many cameras embed a reduced-resolution preview image inside the EXIF header of a JPEG. If the main image has been cropped or altered, the embedded thumbnail may retain the original framing. A mismatch between the thumbnail and the main image is a structural indicator of post-capture editing.

JPEG internal structure and integrity markers

A JPEG file is a sequence of markers, each two bytes long (FF followed by a type byte), followed by a length-prefixed data segment. The file begins with SOI (Start of Image, FF D8) and ends with EOI (End of Image, FF D9). Between them, the examiner finds the APP0 or APP1 marker (which carries JFIF or EXIF metadata), one or more DQT markers (Define Quantisation Table), a SOF marker (Start of Frame, which records image dimensions and encoding parameters), DHT markers (Define Huffman Table), and one or more SOS markers (Start of Scan, which precede the compressed image data).

Forensic analysis of a JPEG begins with a marker audit: are the markers present in a sequence consistent with camera-generated output? Cameras typically produce a fixed sequence. Editing software may reorder markers, introduce new ones (for example, an ICC colour profile marker APP2), or omit markers that the camera included. A JPEG that begins with JFIF (APP0) and also contains full EXIF data (APP1) is unusual, because cameras write one or the other, not both; the combination typically indicates that an image editor rewrote the file header.

The DQT segments are the most forensically valuable part of the JPEG structure. Each camera model uses a specific quantisation table set, derived from the manufacturer's quality settings. Researchers have assembled databases of camera-specific quantisation tables. When the tables in a questioned image match a known camera model but the EXIF claims a different model, or when the tables match Photoshop's defaults rather than any camera, the file's claimed origin is contradicted by its own structure. This analysis does not require the original camera, only the file and a reference database.

JPEG double-compression and re-save detection

JPEG compression divides an image into 8x8-pixel blocks, applies a Discrete Cosine Transform (DCT) to each block, and then quantises the resulting frequency coefficients using the quantisation table. Each coefficient is rounded to the nearest multiple of the corresponding quantisation value. When a JPEG is decoded, altered, and re-encoded at a different quality setting, the DCT coefficients go through two rounds of quantisation. The statistical distribution of DCT coefficients in a doubly-compressed JPEG differs from that of a singly-compressed one in a measurable way: the histogram of coefficients develops characteristic dips at multiples of the first-round quantisation step.

This phenomenon is the basis of double JPEG compression analysis, a well-established forensic method. Tools such as the Ghosts algorithm and related approaches detect the periodicity in the coefficient histogram caused by prior quantisation. If the entire image shows uniform double-compression artefacts, the most likely explanation is a workflow re-save (for example, the image was opened and resaved at a lower quality). If only a region of the image shows double-compression artefacts while the surrounding area does not, that region may have been inserted from a singly-compressed source, or vice versa.

FeatureSingle compressionDouble compression at same qualityDouble compression at different quality
DCT coefficient histogramSmooth, approximately LaplacianSmooth (same table cancels out)Periodic dips at first-round step multiples
Blocking artefactsUniform 8x8 patternSame patternShifted or misaligned 8x8 blocks in some regions
Quantisation tables in fileMatch original cameraMatch original cameraMay match editing software defaults
Thumbnail consistencyThumbnail matches main imageThumbnail matches main imageThumbnail may retain pre-edit version

Regional double-compression analysis is more complex than whole-image analysis. The boundary between a doubly-compressed inserted region and a singly-compressed background is not always sharp, because JPEG block boundaries do not align with object edges. Examiners use this analysis to flag areas for further investigation, not to assert the exact boundary of an inserted element. Pixel-level methods such as copy-move and splicing detection are used in conjunction to narrow the location and nature of any manipulation.

PNG chunk structure and anomaly detection

A PNG file begins with an eight-byte signature (89 50 4E 47 0D 0A 1A 0A) followed by a sequence of chunks. The structure is strictly defined by the PNG specification (ISO/IEC 15948:2004). The first chunk must always be IHDR (Image Header), which declares image dimensions, bit depth, colour type, and interlacing method. The last chunk must always be IEND (Image End). Between them, one or more IDAT chunks carry the compressed pixel data. All other chunks are ancillary and optional.

Forensic chunk analysis checks for: duplicate critical chunks (two IHDR chunks indicates deliberate or accidental header manipulation); chunks appearing in a sequence that violates the PNG specification; ancillary chunks not produced by any camera firmware (such as tEXt chunks containing software names or comment fields populated by editing tools); and CRC mismatches, which indicate that a chunk's data was modified after the checksum was computed. A CRC mismatch on an IDAT chunk is particularly significant because it means the compressed pixel data was altered, which cannot happen accidentally.

The tEXt and iTXt chunks carry human-readable text and can record the software that created or modified the file. A tEXt chunk with the keyword 'Software' and value 'Adobe Photoshop 26.0' is structural evidence that Photoshop wrote the file. This does not prove manipulation of the image content, because legitimate workflows process images in editing software, but it does contradict a claim that the file is an unmodified camera original. The examiner's task is to determine whether the declared processing history is consistent with the claimed context.

TIFF structure and professional imaging workflows

TIFF (Tagged Image File Format, standardised under ISO 12234-2 for the raw form and widely used in its general form) is the preferred format in many law-enforcement and forensic imaging workflows because it supports lossless compression and carries extensive metadata. A TIFF file consists of an Image File Header, one or more Image File Directories (IFDs), and the associated image data. Each IFD is a list of tagged data fields; the tags carry both technical metadata (image dimensions, photometric interpretation, compression type) and provenance metadata (make, model, software, date/time).

Forensic TIFF analysis focuses on the tag inventory. A camera-generated TIFF contains a predictable set of tags. Tags absent in the original but present in the questioned file, or tags whose values are inconsistent with the declared camera (for example, a tag claiming Professional Photo Suite as the writing software in a file claimed to be a direct camera output), indicate post-capture processing. Sub-IFDs, which are nested directory structures used to store thumbnail images or alternate resolutions, are also checked for consistency with the main image.

TIFF supports multiple compression methods within a single file, including no compression, LZW, PackBits, and CCITT Group 4 for bilevel images. The declared compression tag must match the actual data encoding. A file declaring LZW compression but containing data that does not decompress correctly under LZW indicates corruption or deliberate alteration of the compression tag to hide the actual encoding method.

EXIF and XMP metadata as provenance evidence

EXIF metadata is written by the capture device at the moment of capture and is intended to record the conditions under which the image was taken. The DateTimeOriginal field records when the shutter was pressed; the Make and Model fields record the camera; Software records the firmware version or, if the file has been processed, the editing application. Examiners treat the full EXIF block as a set of provenance claims and test each claim for internal consistency and consistency with the file's structural properties.

Three inconsistency patterns are most significant in practice. First, the EXIF Software field names an editing application while the file's quantisation tables match a specific camera model: this is consistent with a workflow where the image was opened but not re-saved at a different quality. Second, the EXIF Software field names a camera firmware version but the quantisation tables match Photoshop defaults: this is consistent with an attempt to restore camera-like EXIF after editing. Third, the EXIF DateTimeOriginal is earlier than the file's filesystem creation timestamp: this is expected for scanned or transferred images but requires explanation in claimed originals.

XMP metadata extends the provenance record further. The xmpMM:History element is an ordered sequence of editing events, each recording the action, the software instance identifier, the date, and the parameters of the action. When this field is populated, it documents the processing history in the file's own structure. The chain of custody for digital media, as discussed in Chain of Custody for Digital Media, requires that any processing applied to an image after acquisition be documented; XMP history is one form of that documentation when present in submitted evidence.

GPS coordinates embedded in EXIF (the GPSLatitude, GPSLongitude, and GPSAltitude tags, when the device recorded them) are a verifiable provenance claim. If the stated location is inconsistent with the scene depicted, or if the GPS timestamp differs from the DateTimeOriginal by more than a few seconds, the coordinates require explanation. They may indicate a device with an incorrect GPS lock, a file transplanted from another device, or deliberate metadata editing.

Check your understanding
Question 1 of 4· 0 answered

A JPEG file begins with the bytes FF D8 FF E0 and the extension .png. What does this indicate?

Key Takeaways

  • Image file format integrity checks examine a file's internal structure (headers, markers or chunks, metadata blocks, and data segments) to determine whether the file is consistent with an unmodified camera original or shows evidence of post-capture processing.
  • JPEG quantisation tables are the most reliable structural indicator of the software that last compressed the file; mismatches between the tables and the declared camera model contradict a camera-original claim without requiring access to the original device.
  • PNG chunk analysis checks for non-standard chunk sequences, unexpected ancillary chunks naming editing software, and CRC mismatches; a CRC mismatch on an IDAT chunk is strong evidence of post-write modification of the pixel data.
  • EXIF and XMP metadata fields are provenance claims to be tested, not trusted records; the xmpMM:History element, when populated, is direct structural evidence of post-capture editing, and thumbnail inconsistency is evidence of cropping or content substitution.
  • Format integrity findings establish what processing history a file carries; they do not by themselves establish what image content was altered, so they are used alongside pixel-level methods such as noise analysis and copy-move detection to form a complete authentication opinion.
What is a file format integrity check in image forensics?
A file format integrity check is a structural analysis of an image file's internal organisation: its header, data segments, metadata blocks, and any ancillary information. Examiners compare what the file declares about itself against what its bytes actually contain. Mismatches, such as a JPEG with PNG-style chunk markers or a file whose embedded thumbnail does not match its main image, indicate that the file was re-saved, converted, or modified after its original capture.
Why does re-saving a JPEG reveal editing?
JPEG is a lossy format. Every time a JPEG is decoded, modified, and re-encoded, a new round of compression artefacts is introduced. The quantisation tables embedded in the file record the compression settings of the last save; when these tables do not match those of the camera model claimed in the EXIF metadata, it indicates re-compression outside the original device. Double-compression analysis tools can detect this mismatch even when the visual difference is imperceptible.
What can EXIF metadata tell a forensic examiner?
EXIF metadata embeds camera make and model, lens information, exposure settings, GPS coordinates (if the device recorded them), a timestamp, and a software field that names the application used to edit or save the file. Examiners treat this data as a provenance claim, then check whether other structural features of the file are consistent with that claim. Inconsistencies between the declared camera and the actual compression profile, or a software field naming an editing application, are evidence of post-capture processing.
How does PNG chunk analysis help detect tampering?
PNG files are structured as a sequence of named chunks, each with a type code, data payload, and CRC-32 checksum. Authentic camera-generated PNGs contain a predictable set of chunks in a standard order. Forensic examiners look for unexpected chunk types, chunks in non-standard positions, duplicate critical chunks, and CRC mismatches. An inserted tEXt or zTXt chunk carrying unexpected text, or a second IHDR chunk, both indicate post-processing outside the original capture device.
Is image file format evidence sufficient on its own to prove tampering in court?
Format integrity evidence supports a finding of post-capture processing but does not by itself prove that a specific manipulation was made. Legitimate workflows such as format conversion, email attachment compression, and social media upload can also alter file structure and metadata. Examiners present format evidence as one strand within a broader authentication analysis, alongside pixel-level analysis, noise inconsistency checks, and copy-move or splicing detection.

Test yourself on Multimedia Authentication and Deepfake Forensics with free, timed mocks.

Practice Multimedia Authentication and Deepfake Forensics questions

Found this useful? Pass it along.

Share

Spotted an error in this page? Report a correction or read our editorial standards.

Your journey to becoming a forensic professional starts here.

Practice with mock tests, learn from structured notes, and get your questions answered by a global forensic community, all in one place.