
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
trustmark
Advanced tools
This repository contains the official, open source implementation of TrustMark watermarking for the Content Authenticity Initiative (CAI) as described in:
TrustMark - Universal Watermarking for Arbitrary Resolution Images (arXiv:2311.18297) by Tu Bui1, Shruti Agarwal2, and John Collomosse1 2.
and later published at ICCV 2025 as TrustMark: Robust Watermarking and Watermark Removal for Arbitrary Resolution Images.
This repository contains the following directories:
/python: Python implementation of TrustMark for encoding, decoding and removing image watermarks (using PyTorch). For information on configuring TrustMark in Python, see Configuring TrustMark./js: Javascript implementation of TrustMark decoding of image watermarks (using ONNX). For more information, see TrustMark - JavaScript implementation./rust: Rust implementation of TrustMark. for more information, see TrustMark — Rust implementation./c2pa: Python example of how to indicate the presence of a TrustMark watermark in a C2PA manifest. For more information, see Using TrustMark with C2PA.Model files (ckpt PyTorch file for Python and onnx ONNX file for JavaScript) are not packaged in this repository due to their size, but are downloaded upon first use. See the code for URLs and md5 hashes for a direct download link.
More information:
You must have Python 3.8.5 or higher to use the TrustMark Python implementation.
The easiest way to install TrustMark is from the Python Package Index (PyPI) by entering this command:
pip install trustmark
Alternatively, after you've cloned the repository, you can install from the python directory:
cd trustmark/python
pip install .
To get started quickly, run the python/test.py script that provides examples of watermarking several
image files from the images directory.
Run the example as follows:
cd trustmark/python
python test.py
You'll see output like this:
Initializing TrustMark watermarking with ECC using [cpu]
Extracted secret: 1000000100001110000010010001011110010001011000100000100110110 (schema 1)
PSNR = 50.357909
No secret after removal
The python/test.py script provides examples of watermarking a JPEG photo, a JPEG GenAI image, and an RGBA PNG image. The example uses TrustMark variant Q to encode the word mysecret in ASCII7 encoding into the image ufo_240.jpg which is then decoded, and then removed from the image.
from trustmark import TrustMark
from PIL import Image
# init
tm=TrustMark(verbose=True, model_type='Q') # or try P
# encoding example
cover = Image.open('images/ufo_240.jpg').convert('RGB')
tm.encode(cover, 'mysecret').save('ufo_240_Q.png')
# decoding example
cover = Image.open('images/ufo_240_Q.png').convert('RGB')
wm_secret, wm_present, wm_schema = tm.decode(cover)
if wm_present:
print(f'Extracted secret: {wm_secret}')
else:
print('No watermark detected')
# removal example
stego = Image.open('images/ufo_240_Q.png').convert('RGB')
im_recover = tm.remove_watermark(stego)
im_recover.save('images/recovered.png')
TrustMark runs well on CPU hardware.
To leverage GPU compute for the PyTorch implementation on Ubuntu Linux, first install Conda, then use the following commands to install:
conda create --name trustmark python=3.10
conda activate trustmark
conda install pytorch cudatoolkit=12.8 -c pytorch -c conda-forge
pip install torch==2.1.2 torchvision==0.16.2 -f https://download.pytorch.org/whl/torch_stable.html
pip install .
For the JavaScript implementation, a Chromium browser automatically uses WebGPU, if available.
TrustMark encodes a payload (the watermark data embedded within the image) of 100 bits. You can configure an error correction level over the raw 100 bits of payload to maintain reliability under transformations or noise.
In payload encoding, the version bits comprise two reserved (unused) bits, and two bits encoding an integer value 0-3 that specifies the data schema as follows:
For more details and information on configuring the encoding mode in Python, see Configuring TrustMark.
If you find this work useful, please give us a star ⭐ and cite the repository and/or TrustMark paper, preferrably as follows:
@inproceedings{Trustmark-ICCV-2025,
title = {TrustMark: Robust Watermarking and Watermark Removal for Arbitrary Resolution Images},
author={Bui, Tu and Agarwal, Shruti and Collomosse, John},
booktitle = {IEEE International Conference on Computer Vision (ICCV)},
year = {2025},
month = oct
}
or cite the earlier ArXiv version:
@article{Trustmark-ArXiv-2023,
title={Trustmark: Universal Watermarking for Arbitrary Resolution Images},
author={Bui, Tu and Agarwal, Shruti and Collomosse, John},
journal = {ArXiv e-prints},
archivePrefix = "arXiv",
eprint = {2311.18297},
year = 2023,
month = nov
}
This package is is distributed under the terms of the MIT license.
FAQs
TrustMark: Universal Watermarking for Arbitrary Resolution Images
We found that trustmark demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.