jpeg_ghost_map — IMGFORENSICS compression op

Data kinds: image2dimages

Call: import imgforensics; imgforensics.jpeg_ghost_map(image, qualities=None, block: 'int' = 16) -> 'list' (or opsimgforensics.get("jpeg_ghost_map"))

Usage

JPEG ghosts (Farid 2009). A series of re-compression residual maps over a quality sweep. `images`.

> The detailed description below is the original text — the summary and the headings are translated.

ある領域が品質 `q0 で一度圧縮されていると、q = q0` で再圧縮したときに

その領域の差分が になる。画像全体が同じ `q0` なら谷は全面に出るが、

別の品質で圧縮された部分が貼られていると、**その領域だけ別の `q` で谷になる**。

返りは `len(qualities) 本の (H, W) 地図(block` 角の箱平均で平滑化した

二乗差)。谷の位置を画素ごとに読むのは :func:jpeg_ghost_quality

Pillow 必須(:class:ImportError)。理由は :func:error_level_map と同じ。

実測(`tests/test_imgforensics.py::test_jpeg_ghost_finds_the_pasted_quality`、

品質 92 の背景に品質 60 で圧縮した 64x64 を貼った 192x192、掃引 40..95 step 5):

貼った領域の谷は 品質 60(真値 60、誤差 0)、背景の谷は 品質 95

背景が 92 ではなく 95 になるのは掃引が 5 刻みで 92 を含まないからで、

谷は掃引した品質の中からしか出ない —— 刻みより細かい品質は読めない。

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

image_forensics_auditpy -3.11 examples/image_forensics_audit.py

Ops the type connects to (they accept images as input)

sensor_fingerprint · jpeg_ghost_quality

Same category (compression)

error_level_map · jpeg_quality_estimate · jpeg_ghost_quality


*Provenance: imgforensics.py — IMGFORENSICS operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.