Re: PSA Using Python Pillow to foil camera image PRNU fingerprinting
Maria Sophia <[email protected]> Sat, 1 Aug 2026 09:42:11 -0800
| Newsgroups | gmane.comp.python.general |
|---|---|
| Organization | BWH Usenet Archive (https://usenet.blueworldhosting.com) |
| Message-ID | <[email protected]> |
Piergiorgio Sartor wrote:
> I'm under the impression there is some
> confusion here.
> It seems to me there is a lot to explore way
> beyond the simple image modification algorithms.
Hi Piergiorgio,
Thank you for your expert input, as you obviously understand the topic
better than I do, by far, so your advice is welcome and very useful.
I'm slow...
Lawrence tried 2 turns before I realized he was suggesting calibration.
You also tried 2 turns before I began to understand the fake-PRNU concept
For example, you stress the verb "apply" rather than the verb "add".
a. You stress my scripts only add noise [img = img + noise]
b. You stress a real PRNU is different [img = img * (1 + prnu-map)]
Is that what you're saying?
If so, you (& Lawrence) are bringing up EXCELLENT points, where, for
example, Lawrence prodded me into building the calibration script, which, I
think, is a vast improvement on the single-image PRNU script prior.
My goal is to provide myself and others a script to run on our images to
avoid fingerprinting of images that we ourselves, post to various websites.
I first must admit I know almost nothing about PRNU fingerprinting (or
AI-watermark identification), so any and all help and advice is welcome.
Second, I must admit I have to look up in depth what you and Lawrence say,
'cuz I'm a noob in this stuff. I don't know anything about fingerprinting.
I simply want to find or write a script that I can run on an image from my
own camera that obfuscates the fingerprint, and I want others to have it.
Because my goal, here anyway, is to provide ,myself & others with a usable
script that they can use themselves to avoid correlation fingerprinting.
Looking up what you said in the prior post, am I write in summarizing:
a. I seem to be confusing PRNU with ordinary image noise.
b. You're saying PRNU is a fixed-pattern noise, not random temporal noise
c. Adding noise does not mimic PRNU because PRNU is a per-pixel factor
d. Denoising algorithms operate only on spatial noise in a single image.
e. BM3D doesn't know anything about temporal noise or sensor noise
f. If we denoise an image, we remove the original PRNU
g. If we subsequently realistically re-noise the image
we can create a new fingerprint (if the noise is realistic spatially)
A takeaway is that adding or removing noise doesn't help much with PRNU.
On the other hand, overlaying a completely fake PRNU works better.
So, I may be confused, which is why I appreciate that you're gently chiding
me to be more responsive to what you're saying, and not what I think prior.
Are you saying...
1. We should first remove the original PRNU
2. And then we should apply a realistically synthetic PRNU
3. Which produces a new fingerprint, different from the camera
If so, that's a great idea as then all images in one batch uploaded to the
net will have a similar realistic fingerprint, instead of being random.
Are you also saying...
A. The initial denoising is actually optional but still useful
B. By adding a fake PRNU, image quality remains mostly intact
C. It's the fake PRNU that is most effective because just
adding noise doesn't remove the underlying fingerprint
And yes, I get the point that generative AI can produce images with no PRNU
but, as noted in the other thread, AI-generated images have watermarks.
Message-ID: <[email protected]>
Also, it took me a long time to figure out your autoencoder suggestion.
Is this what you're saying about the autoencoders?
a. An autoencoder reconstructs image content, not noise (incl. PRNU)
b. They discard sensor-specific noise patterns
c. So autoencoders may be better than BM3D
import torch
from torchvision import transforms
model = torch.load("denoiser.pth")
model.eval()
img_tensor = transforms.ToTensor()(img).unsqueeze(0)
denoised = model(img_tensor).squeeze().permute(1,2,0).numpy()
For the benefit of others noobs like I am on image manipulation...
a. BM3D Block-Matching 3D is a denoising algorithm
b. Which finds similar patches and stacks them into 3D blocks
c. And then filters and aggregates the patches back into the image
pip install bm3d
from bm3d import bm3d
denoised = bm3d(image, sigma_psd=10/255)
Overall, I think what you're saying, in a nutshell, is the most effective
approach is for us to come up with a way to add a fake PRNU fingerprint.
Is that right?
--
On Usenet you find people who know more than you, yourself, will ever know.