Hello,
Curious by the subject I decided to quickly give it a go on my side.
My theory is that if the file is edited, by retrivieving the undebayered camera data from the RAW file, you would notice an offset in the camera sensor array.
So I made a quick python script that allow me to retrieve that information and save it to disk for previewing.
The dependencies used as listed at the top of the script.
OpenImageIO is a hard to get dependency, but you could use anything like OpenCV, Pillow as I’m just writing a numpy array to disk.
"""
[dependencies]
python = ">=3.10,<3.12"
numpy = "1.26.*"
rawpy = "0.19.0"
openimageio = { path = "./vendor/OpenImageIO/OpenImageIO-2.2.18.0-cp310-cp310-win_amd64.whl", markers = "sys_platform == 'win32'" }
"""
from pathlib import Path
import numpy
import rawpy._rawpy as rawpy
import OpenImageIO as oiio
def oiioconvert_array_to_image(array: numpy.ndarray) -> oiio.ImageBuf:
"""
Convert a numpy array to an OIIO ImageBuf.
"""
typedesc = oiio.UINT16 # XXX: hardcoded
image_spec = oiio.ImageSpec(
array.shape[1],
array.shape[0],
array.shape[2],
typedesc,
)
image_buf = oiio.ImageBuf(image_spec)
image_buf.set_pixels(oiio.ROI(), array)
return image_buf
def main():
INPUT_PATH = Path(r"G:\temp\RAWS aerial skies japan\dng\IMG_1840.dng")
OUTPUT_PATH = INPUT_PATH.parent / (INPUT_PATH.parent.stem + "_raw.exr")
# // READ raw unbayered pixels
processor = rawpy.RawPy()
processor.open_file(str(INPUT_PATH))
raw_image_array: numpy.ndarray = processor.raw_image.copy()
processor.close()
print(raw_image_array)
# // CONVERT single channel to 3 channels
raw_image_array_rgb = numpy.dstack([raw_image_array] * 3)
print(raw_image_array_rgb.shape, raw_image_array_rgb.dtype)
# // CONVERT to OIIO object
raw_imagebuf = oiioconvert_array_to_image(raw_image_array_rgb)
# // WRITE image to disk
if raw_imagebuf.has_error:
raise RuntimeError(f"Provided ImageBuf has errors: {raw_imagebuf.geterror()}")
print(f"Writing {OUTPUT_PATH}")
raw_imagebuf.write(str(OUTPUT_PATH), oiio.FLOAT)
if __name__ == "__main__":
main()
Using that script my workflow was as follow:
- download .CR2 files from the Gdrive link provided
- convert the .CR2 file to .DNG for maximum compatibility using Adobe DNG converter
- read the
IMG_1840.dng
using the script, and write to a file named IMG_1840_raw.exr
(the OpenEXR format is VFX industry format to store floating point data, using here a lossless compression method)
- inspect the content of
IMG_1840_raw.exr
file
The sensor pattern is uniform across all the picture which implies that if there was any malicious edit the person also took time to reverse-engineer the debayer pattern from the input image he used for image-manipulation which I’m not sure is even possible.
Here is the .exr converted to .jpg (100% quality export) with a contrast boost to make it more easy to see the sensor pattern :
(EDIT: even though the jpg is super sharp on my computer, it seems to receive extra compression or filtering once uploaded, so download the exr below)
My conclusion is that those are 100% legit RAW files.
An advice is that it is good to doubt about everything, but then perhaps also start doubting about the image-processing software you use. There is no guarantee those will perform the operation you expect them to do without doing a few trick implemented internally, for various reason like optimisations, etc. Which might make it hard to imply that something that looks “off” is not just the fault of your software, or your utilisation of the software which was not expecting this.
You can find attached the .exr produced from my script:
dng_raw.exr (39.4 MB)
Best,
Liam