A photo can sometimes be linked to a specific camera by comparing its sensor pattern with a reference built from known images.
One part of that pattern is PRNU, short for photo-response non-uniformity. Pixels respond slightly differently to the same light, leaving faint variations that can recur across photos.
In this test, two software models produce images of the same launch scene. Each original scores highest against its own reference.
Then the Sensor A score drops after a JPEG export, even though the source stays the same. You’ll see why a weak result needs context.
What Does a Camera Fingerprint Test Compare?
Imagine that you have a photo and two candidate devices. The question is whether the photo carries a pattern consistent with either candidate’s reference.
You need two kinds of material. Known images help estimate each reference pattern. The separate test image is the file whose source you want to evaluate.
The reference is a grid of values. Think of it as a map of the small variations that tend to recur at particular pixel positions.
The test image gives you a second grid after you subtract a blurred copy. The leftover detail is called a residual.
The score measures how the residual and the reference vary together at the same pixel positions. A recognizable feature can remain in the residual.
Image metadata may name a camera model. A PRNU test asks a more specific question about a candidate sensor’s pattern in the pixels.
The two devices in this article are software models. The real launch photograph supplies the scene shown to both. It supplies no reference for the camera that took it.
That separation lets us ask a question with a known answer. We know which synthetic sensor produced each test image, including the one later saved as a JPEG.
Step 1. Build a Reference for Each Sensor
Imagine that two sensors both look at a flat bright surface. Their tiny variations in response form different patterns, even when the surface is the same.
The PRNU and camera sensor fingerprinting lesson explains how examiners estimate those patterns from multiple images and compare them with a questioned photo.
For this teaching test, each synthetic sensor supplied 12 reference frames at 320 × 320 pixels. The frames had smooth brightness variations and independent random noise.
I subtracted a blurred copy from each frame and averaged the differences by sensor. The resulting reference patterns are displayed with their contrast amplified.
A residual is what remains after subtracting a smoothed version of the image. It can contain other details and noise too, so it needs comparison.
How the Reference Differs From a Photo
The launch scene is immediately recognizable. The reference squares look like fine grain because they show variations in pixel response, with the contrast amplified.
We built each reference from several frames, with different brightness variations. Averaging helps recurring patterns stand out against random variation in any one frame.
The images here show an amplified view for the reader. The correlation calculations use the underlying residual values before that display adjustment.
Why the Reference Uses Several Frames
A photo contains edges from the scene and variations from the sensor. Subtracting a smoothed copy can leave some of both behind.
In the launch image, the shape of the rocket may still be recognizable in a residual. That structure comes from the image and can influence a comparison.
The reference frames vary in brightness across space. Averaging their residuals gives recurring variation a better chance to stand out in this model.
Consider what would happen if all reference images contained the same sharp object in exactly the same place. Part of that shared detail could remain in the average.
Reference selection matters for that reason. A student can check the setup by asking whether repeated scene structure might account for an apparently strong comparison.
Our model uses 12 different reference frames per sensor. That number describes this run. Practical reference requirements depend on the method, device, and quality of available images.
Keep the Scene and the Sensor Separate
The experiment has one known grayscale scene, two reference patterns, and two separate captures of the same scene. Each capture carries one model’s variation.
That arrangement gives you an A-versus-B control. If the score follows only the visible scene, both original test rows could look similar across the two references.
The results instead favor the corresponding reference for each original. That tells you something about the setup before you ask what export or alignment changes.
Step 2. Compare Both References With the Test Image
I used a public-domain SpaceX launch photograph as the test scene. I cropped it to 320 × 320 pixels and converted it to grayscale.
Both synthetic sensors received that scene as input. The test frames were generated separately from the images used to build either reference.
I compared the residual in each frame with both references using the Pearson correlation coefficient, a score for how closely two patterns vary together.
Scroll horizontally if needed to see the full table.
Read across the Sensor A row first. It scores 0.381 against reference A and 0.004 against B.
Then read across the Sensor B row. It scores 0.384 against B and roughly zero against A. The stronger score follows the known source in each row.
Because both sensors received the same scene, the second row helps you check whether the scores follow the source rather than the scene.
Read Both Columns of the Result
The first row is useful because you can compare it across both references. A high value in one column means more when the alternative was tested too.
A score near zero means little linear agreement in this run. It is not a probability. The test also covers only two candidates.
Look for the control row before interpreting the result. Here, Sensor B reverses the pattern you see in the first row.
What If Both Scores Are High or Both Are Low?
Suppose both references return similarly high scores. The comparison has little power to separate those candidates by itself. Check the references and the independence of the test images.
If both scores are low, check whether the files share a usable image region and whether the residual contains enough signal to compare.
A missing candidate is another possibility. A comparison with two references can say how those two performed. It gives no direct result for devices outside the comparison.
In casework, a decision threshold belongs to a validated method and tested conditions. The numbers in this exercise are descriptive results from a simplified model.
Step 3. Check What JPEG Export Changes
I saved the Sensor A frame as a JPEG at Pillow quality 45 without resizing it, then measured the same two scores again.
The A-reference score fell from 0.381 to 0.025.
The source was the same by construction. The export had changed enough image detail to weaken the observed correlation.
The enlarged detail shows one crop from the residual in each version. Both use the same crop and contrast scaling. The JPEG result has different local structure.
A low result can have several explanations in practice. Image processing, a poor reference, or misalignment can weaken a comparison.
These scores describe this synthetic test and have no casework threshold.
The model uses a simple blur subtraction on 8-bit images and represents none of a real camera's processing pipeline.
Check What Changed Between Files
Before comparing originals and exports, note the dimensions and which version supplied the test pixels. An exported copy can preserve the visible scene while changing fine image detail.
The JPEG control here keeps the pixel dimensions constant. The alignment control changes the coordinate pairing during measurement and keeps the test image bytes constant.
Those two tests answer separate questions. One asks what happened after encoding the image. The other asks what happens when the reference positions do not correspond.
If a real comparison mixes both changes, you may have several plausible reasons for a surprisingly low value. Locate the original file or test the conditions separately where possible.
Document the channel or image representation you analyzed. The current example uses grayscale. A method that uses other channels or different filtering may produce different results.
Step 4. Check That the Pixels Line Up
A sensor pattern belongs to positions on an image grid. If you compare different positions, you may get a different score from exactly the same image.
I compared a 319-column overlap using the matching coordinates, then paired it with reference coordinates one column away. Both measurements used the same overlapping area size.
The aligned comparison scored 0.381. The offset comparison scored −0.032. This is a separate control from JPEG export, and the image bytes stayed the same.
What Makes the Comparison Fair?
Both sensors received the same test scene. This makes it easier to see whether the score is following the sensor pattern or the scene.
The reference and test frames were generated separately. Testing a frame against a reference that already includes it could inflate its score.
The run used random seed 527 and a Gaussian blur radius of 2 pixels.
The original comparisons used the full 320 × 320 grid. The alignment check used a 319-column overlap so both pairings used the same number of pixels.
How to Report a PRNU Comparison
Record the candidate references, the number of known files used for each, and how those files were chosen. Identify the test file independently of those references.
Describe the crop or area used in the comparison. Record dimensions, alignment, and relevant processing history. Keep enough information for someone else to inspect the same pixels.
Name the score you computed. The tables here report Pearson correlation. Some published methods use a different measure, such as peak-to-correlation energy.
A useful note includes both the result and the comparison conditions. “Synthetic A original, aligned, reference A, correlation 0.381” ties the number to a particular test.
Add the controls beside the result. Record the alternative reference, the export comparison, and the offset comparison as separate measured observations.
For the JPEG row, a useful report would say that the two tested references gave little separation after export. The file’s source remains known in this exercise.
In casework, a camera-source result addresses the imaging device. To establish who took the photo or when, you need other evidence.
Then write a sentence about the limit. For this example, the results show how the known synthetic sources behaved under the chosen test conditions.
Practice Reading the JPEG Result
Imagine the file you receive is the JPEG row without its label. Put the two reference scores beside each other and decide what they support.
One answer is that the scores offer little separation under these conditions. You would want more provenance about the test file and a usable earlier version if available.
Now reveal the row’s label. The example came from A by construction. The low value is useful because it shows why a weak comparison needs a careful explanation.
Finish by writing the result as an observation about the tested files. Keep the source question and the quality of the available comparison distinct in your report.
Try the same check on the original Sensor B row. Read both scores and write what favors B under the conditions of this experiment.