From e790affc82962dbcbd1038d06f580f299bca234c Mon Sep 17 00:00:00 2001 From: Rand McKinney Date: Wed, 12 Mar 2025 17:34:46 -0700 Subject: [PATCH 1/8] Add trustmark to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a039e0d..4a6ecce 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ /docs/rust-sdk/docs/*.md /docs/**/readme.md /static/sb-alg-list.json +/docs/trustmark/*.md # Misc .DS_Store From 28d003c6b8b31daa1fcf18bc51d88ede2803dc35 Mon Sep 17 00:00:00 2001 From: Rand McKinney Date: Wed, 12 Mar 2025 17:35:05 -0700 Subject: [PATCH 2/8] Add TrustMark --- docs/trustmark/.gitkeep | 0 scripts/fetch-readme.js | 26 ++++++++++++++++++++++++++ sidebars.js | 28 ++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 docs/trustmark/.gitkeep diff --git a/docs/trustmark/.gitkeep b/docs/trustmark/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/scripts/fetch-readme.js b/scripts/fetch-readme.js index 903baf2..7f2d3bc 100644 --- a/scripts/fetch-readme.js +++ b/scripts/fetch-readme.js @@ -194,6 +194,32 @@ const readmes = [ repo: 'c2pa-org/softbinding-algorithm-list', path: 'softbinding-algorithm-list.json', }, + // TrustMark + { + dest: resolve(__dirname, '../docs/trustmark/readme.md'), + repo: 'adobe/trustmark', + path: 'README.md', + }, + { + dest: resolve(__dirname, '../docs/trustmark/config.md'), + repo: 'adobe/trustmark', + path: 'CONFIG.md', + }, + { + dest: resolve(__dirname, '../docs/trustmark/faq.md'), + repo: 'adobe/trustmark', + path: 'FAQ.md', + }, + { + dest: resolve(__dirname, '../docs/trustmark/python-readme.md'), + repo: 'adobe/trustmark', + path: 'python/README.md', + }, + { + dest: resolve(__dirname, '../docs/trustmark/js-readme.md'), + repo: 'adobe/trustmark', + path: 'js/README.md', + }, ]; function resolveMarkdownLinks(linkBase, content) { diff --git a/sidebars.js b/sidebars.js index e618ab0..a3ce77f 100644 --- a/sidebars.js +++ b/sidebars.js @@ -269,6 +269,34 @@ const sidebars = { label: 'Watermarking and fingerprinting', id: 'sb-algs', }, + { + type: 'category', + label: 'TrustMark', + link: { type: 'doc', id: 'trustmark/readme' }, + collapsed: true, + items: [ + { + type: 'doc', + id: 'trustmark/faq', + label: 'FAQ', + }, + { + type: 'doc', + id: 'trustmark/config', + label: 'Configuration', + }, + { + type: 'doc', + id: 'trustmark/js-readme', + label: 'TrustMark JS', + }, + { + type: 'doc', + id: 'trustmark/python-readme', + label: 'FAQ', + }, + ], + }, ], }, { From 2bb61b6052da60e2f794785a6cae49a0fd068f0e Mon Sep 17 00:00:00 2001 From: Rand McKinney Date: Thu, 13 Mar 2025 16:57:29 -0700 Subject: [PATCH 3/8] Add overview and reorg --- docs/trustmark-oveview.md | 31 +++++++++++++++++++++++++++++++ sidebars.js | 16 ++++++++-------- 2 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 docs/trustmark-oveview.md diff --git a/docs/trustmark-oveview.md b/docs/trustmark-oveview.md new file mode 100644 index 0000000..d64b984 --- /dev/null +++ b/docs/trustmark-oveview.md @@ -0,0 +1,31 @@ +--- +id: trustmark-overview +title: TrustMark watermarking +--- + +TrustMark is an open-source universal watermarking system for images that: +- Can encode, decode, and remove watermarks from images. +- Works with arbitrary resolution images. +- Has implementations in both Python (using PyTorch) and JavaScript (using ONNX). + +## Variants + +TrustMark has three primary model variants, each with different characteristics. + +Images encoded with one variant cannot be decoded with another variant, so you need to stick with the same variant throughout your pipeline. + +- **Variant Q (Default)** Use in most cases, where you want a good balance between robustness and imperceptibility. PSNR is 48-50 dB. +- **Variant P** - Use when image quality is the top priority. PSNR is 43-45 dB. +- **Variant C (Compact)** - Use if you need to minimize model size and can live with slightly lower visual quality. PSNR is 38-39 dB. + +The general recommendation is to use either: +- Variant Q for most use cases +- Variant P when visual quality is paramount + +### About PSNR + +PSNR (Peak Signal-to-Noise Ratio) is a technical metric used to measure image quality, particularly when comparing an original image to a modified version (in this case, the watermarked image). PSNR is measured in decibels (dB), and higher values indicate better image quality: +- Values around 40+ dB typically indicate very good quality +- Values around 30 dB indicate acceptable quality +- Values below 20 dB usually indicate poor quality + diff --git a/sidebars.js b/sidebars.js index a3ce77f..9ddadd3 100644 --- a/sidebars.js +++ b/sidebars.js @@ -271,14 +271,14 @@ const sidebars = { }, { type: 'category', - label: 'TrustMark', - link: { type: 'doc', id: 'trustmark/readme' }, + label: 'TrustMark watermarking', + link: { type: 'doc', id: 'trustmark-overview' }, collapsed: true, items: [ { type: 'doc', - id: 'trustmark/faq', - label: 'FAQ', + id: 'trustmark/readme', + label: 'Overview', }, { type: 'doc', @@ -287,13 +287,13 @@ const sidebars = { }, { type: 'doc', - id: 'trustmark/js-readme', - label: 'TrustMark JS', + id: 'trustmark/faq', + label: 'FAQ', }, { type: 'doc', - id: 'trustmark/python-readme', - label: 'FAQ', + id: 'trustmark/js-readme', + label: 'JavaScript implementation', }, ], }, From f6c887317552d44dc419f7376866bbb0ecc43a5f Mon Sep 17 00:00:00 2001 From: Rand McKinney Date: Fri, 14 Mar 2025 10:08:47 -0700 Subject: [PATCH 4/8] Revise overview and sidebar entries --- docs/trustmark-oveview.md | 5 +++++ sidebars.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/trustmark-oveview.md b/docs/trustmark-oveview.md index d64b984..81260b8 100644 --- a/docs/trustmark-oveview.md +++ b/docs/trustmark-oveview.md @@ -4,10 +4,15 @@ title: TrustMark watermarking --- TrustMark is an open-source universal watermarking system for images that: + - Can encode, decode, and remove watermarks from images. - Works with arbitrary resolution images. - Has implementations in both Python (using PyTorch) and JavaScript (using ONNX). +:::info +For full technical details and help getting started with TrustMark, see [TrustMark - Quick start](trustmark/readme.md#quick-start). +::: + ## Variants TrustMark has three primary model variants, each with different characteristics. diff --git a/sidebars.js b/sidebars.js index 9ddadd3..c8efa71 100644 --- a/sidebars.js +++ b/sidebars.js @@ -293,7 +293,7 @@ const sidebars = { { type: 'doc', id: 'trustmark/js-readme', - label: 'JavaScript implementation', + label: 'JavaScript example', }, ], }, From 6848f5285c0cac86c81a9cdd6651a619593e5a81 Mon Sep 17 00:00:00 2001 From: Rand McKinney Date: Fri, 14 Mar 2025 10:28:09 -0700 Subject: [PATCH 5/8] John's comments --- docs/trustmark-oveview.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/trustmark-oveview.md b/docs/trustmark-oveview.md index 81260b8..3a2e407 100644 --- a/docs/trustmark-oveview.md +++ b/docs/trustmark-oveview.md @@ -19,8 +19,8 @@ TrustMark has three primary model variants, each with different characteristics. Images encoded with one variant cannot be decoded with another variant, so you need to stick with the same variant throughout your pipeline. -- **Variant Q (Default)** Use in most cases, where you want a good balance between robustness and imperceptibility. PSNR is 48-50 dB. -- **Variant P** - Use when image quality is the top priority. PSNR is 43-45 dB. +- **Variant Q (Default)** Use in most cases, where you want a good balance between robustness and imperceptibility. PSNR is 43-45 dB. +- **Variant P** - Use when image quality is the top priority. PSNR is 48-50 dB. - **Variant C (Compact)** - Use if you need to minimize model size and can live with slightly lower visual quality. PSNR is 38-39 dB. The general recommendation is to use either: @@ -30,7 +30,7 @@ The general recommendation is to use either: ### About PSNR PSNR (Peak Signal-to-Noise Ratio) is a technical metric used to measure image quality, particularly when comparing an original image to a modified version (in this case, the watermarked image). PSNR is measured in decibels (dB), and higher values indicate better image quality: -- Values around 40+ dB typically indicate very good quality -- Values around 30 dB indicate acceptable quality -- Values below 20 dB usually indicate poor quality +- Values around 45+ dB typically indicate very good quality +- Values around 40 dB indicate acceptable quality +- Values below 30 dB usually indicate poor quality, unacceptable for most uses. From 68f023bbc8f5b0408774be524a739a2790a01962 Mon Sep 17 00:00:00 2001 From: Rand McKinney Date: Fri, 14 Mar 2025 10:30:57 -0700 Subject: [PATCH 6/8] clean up --- docs/trustmark-oveview.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/trustmark-oveview.md b/docs/trustmark-oveview.md index 3a2e407..4603465 100644 --- a/docs/trustmark-oveview.md +++ b/docs/trustmark-oveview.md @@ -30,7 +30,7 @@ The general recommendation is to use either: ### About PSNR PSNR (Peak Signal-to-Noise Ratio) is a technical metric used to measure image quality, particularly when comparing an original image to a modified version (in this case, the watermarked image). PSNR is measured in decibels (dB), and higher values indicate better image quality: -- Values around 45+ dB typically indicate very good quality -- Values around 40 dB indicate acceptable quality -- Values below 30 dB usually indicate poor quality, unacceptable for most uses. +- Values around 45+ dB typically indicate very good quality. +- Values around 40 dB indicate acceptable quality. +- Values below 30 dB indicate poor quality, unacceptable for most uses. From 67a2fdcdc0822a0063bef83778b2ba11ebb0ce17 Mon Sep 17 00:00:00 2001 From: Rand McKinney Date: Fri, 14 Mar 2025 15:04:09 -0700 Subject: [PATCH 7/8] Add TOC to FAQ --- docs/trustmark-faq.mdx | 52 +++++++++++++++++++ ...rustmark-oveview.md => trustmark-intro.md} | 12 ++--- sidebars.js | 4 +- src/css/custom.css | 6 +++ 4 files changed, 66 insertions(+), 8 deletions(-) create mode 100644 docs/trustmark-faq.mdx rename docs/{trustmark-oveview.md => trustmark-intro.md} (72%) diff --git a/docs/trustmark-faq.mdx b/docs/trustmark-faq.mdx new file mode 100644 index 0000000..4cb3667 --- /dev/null +++ b/docs/trustmark-faq.mdx @@ -0,0 +1,52 @@ +--- +id: tm-faq +title: TrustMark FAQ +hide_table_of_contents: true +--- + +- [General Usage and Adoption](#general-usage-and-adoption) + - [What is TrustMark?](#what-is-trustmark) + - [How does TrustMark compare to traditional visible watermarks?](#how-does-trustmark-compare-to-traditional-visible-watermarks) + - [What is this software?](#what-is-this-software) + - [Can I integrate TrustMark into my own application?](#can-i-integrate-trustmark-into-my-own-application) + - [Can I use TrustMark in commercial projects?](#can-i-use-trustmark-in-commercial-projects) + - [Why would I want to make an image identifiable using TrustMark?](#why-would-i-want-to-make-an-image-identifiable-using-trustmark) + - [Can TrustMark be embedded in any images, including those generated by AI?](#can-trustmark-be-embedded-in-any-images-including-those-generated-by-ai) + - [How does TrustMark align with provenance standards such as the C2PA?](#how-does-trustmark-align-with-provenance-standards-such-as-the-c2pa) + - [Does TrustMark alter metadata or EXIF information?](#does-trustmark-alter-metadata-or-exif-information) +- [Technical Details](#technical-details) + - [Does TrustMark support my image format?](#does-trustmark-support-my-image-format) + - [Does TrustMark work on grayscale images?](#does-trustmark-work-on-grayscale-images) + - [How fast is TrustMark?](#how-fast-is-trustmark) + - [What are the image resolution limits of TrustMark?](#what-are-the-image-resolution-limits-of-trustmark) + - [How robust is TrustMark?](#how-robust-is-trustmark) + - [Can I print TrustMark?](#can-i-print-trustmark) + - [Can TrustMark be embedded in vector graphics?](#can-trustmark-be-embedded-in-vector-graphics) + - [What dataset was TrustMark trained on?](#what-dataset-was-trustmark-trained-on) + - [What happens if I apply TrustMark to an already watermarked image?](#what-happens-if-i-apply-trustmark-to-an-already-watermarked-image) + - [How does TrustMark compare to State of the Art Watermarking approaches](#how-does-trustmark-compare-to-state-of-the-art-watermarking-approaches) + - [Can TrustMark co-exist with other watermarks?](#can-trustmark-co-exist-with-other-watermarks) +- [Configuration](#configuration) + - [Which variant of TrustMark should I use?](#which-variant-of-trustmark-should-i-use) + - [How can I trade off between robustness and capacity?](#how-can-i-trade-off-between-robustness-and-capacity) + - [How can I trade off between robustness and quality?](#how-can-i-trade-off-between-robustness-and-quality) + - [Can I control where the watermark is embedded in an image?](#can-i-control-where-the-watermark-is-embedded-in-an-image) + - [Does TrustMark affect the file size of an image?](#does-trustmark-affect-the-file-size-of-an-image) +- [Security and Privacy](#security-and-privacy) + - [Can TrustMark be removed?](#can-trustmark-be-removed) + - [Can TrustMark be used to track users or infringe on privacy?](#can-trustmark-be-used-to-track-users-or-infringe-on-privacy) + - [Can TrustMark be used to secretly mark images without user consent?](#can-trustmark-be-used-to-secretly-mark-images-without-user-consent) + - [Is TrustMark steganographic watermarking?](#is-trustmark-steganographic-watermarking) + - [Why release removal code?](#why-release-removal-code) + - [Does TrustMark interfere with other AI or image processing tasks like object detection?](#does-trustmark-interfere-with-other-ai-or-image-processing-tasks-like-object-detection) + - [Can TrustMark be used to detect image manipulation?](#can-trustmark-be-used-to-detect-image-manipulation) + - [Can TrustMark be transferred from one image to another?](#can-trustmark-be-transferred-from-one-image-to-another) + - [What stops someone from spoofing a TrustMark?](#what-stops-someone-from-spoofing-a-trustmark) +- [Future Developments](#future-developments) + - [Will TrustMark support other media types like video?](#will-trustmark-support-other-media-types-like-video) + - [Is TrustMark compatible with blockchain technology?](#is-trustmark-compatible-with-blockchain-technology) + - [Can TrustMark be used for NFT provenance?](#can-trustmark-be-used-for-nft-provenance) + +import Faq from './trustmark/faq.md'; + + diff --git a/docs/trustmark-oveview.md b/docs/trustmark-intro.md similarity index 72% rename from docs/trustmark-oveview.md rename to docs/trustmark-intro.md index 4603465..096c257 100644 --- a/docs/trustmark-oveview.md +++ b/docs/trustmark-intro.md @@ -1,5 +1,5 @@ --- -id: trustmark-overview +id: trustmark-intro title: TrustMark watermarking --- @@ -10,7 +10,7 @@ TrustMark is an open-source universal watermarking system for images that: - Has implementations in both Python (using PyTorch) and JavaScript (using ONNX). :::info -For full technical details and help getting started with TrustMark, see [TrustMark - Quick start](trustmark/readme.md#quick-start). +For full technical details and help getting started with TrustMark, see [TrustMark - Overview](trustmark/readme.md). ::: ## Variants @@ -24,12 +24,12 @@ Images encoded with one variant cannot be decoded with another variant, so you n - **Variant C (Compact)** - Use if you need to minimize model size and can live with slightly lower visual quality. PSNR is 38-39 dB. The general recommendation is to use either: -- Variant Q for most use cases -- Variant P when visual quality is paramount +- Variant Q for most use cases. +- Variant P when visual quality is paramount. -### About PSNR +## About PSNR -PSNR (Peak Signal-to-Noise Ratio) is a technical metric used to measure image quality, particularly when comparing an original image to a modified version (in this case, the watermarked image). PSNR is measured in decibels (dB), and higher values indicate better image quality: +PSNR (Peak Signal-to-Noise Ratio) is a measure of image quality when comparing an original image to the watermarked image. PSNR is measured in decibels (dB), with higher values indicating better quality: - Values around 45+ dB typically indicate very good quality. - Values around 40 dB indicate acceptable quality. - Values below 30 dB indicate poor quality, unacceptable for most uses. diff --git a/sidebars.js b/sidebars.js index c8efa71..ac80edf 100644 --- a/sidebars.js +++ b/sidebars.js @@ -272,7 +272,7 @@ const sidebars = { { type: 'category', label: 'TrustMark watermarking', - link: { type: 'doc', id: 'trustmark-overview' }, + link: { type: 'doc', id: 'trustmark-intro' }, collapsed: true, items: [ { @@ -287,7 +287,7 @@ const sidebars = { }, { type: 'doc', - id: 'trustmark/faq', + id: 'tm-faq', label: 'FAQ', }, { diff --git a/src/css/custom.css b/src/css/custom.css index 46a7f1a..7c39fbc 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -418,3 +418,9 @@ body:not(.is-scrolling) .navbar { .trust-table th:nth-child(1) { width: 170px; } + +/* For content to be displayed only in GitHub. Typically this will be used in imported markdown files. */ + +.github-only { + display: none; +} From db5c19ee8bba87e00135e66d26ff837c27e02521 Mon Sep 17 00:00:00 2001 From: Rand McKinney Date: Fri, 14 Mar 2025 15:31:09 -0700 Subject: [PATCH 8/8] Add GitHub link to sidebar --- sidebars.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sidebars.js b/sidebars.js index ac80edf..bf2382a 100644 --- a/sidebars.js +++ b/sidebars.js @@ -295,6 +295,11 @@ const sidebars = { id: 'trustmark/js-readme', label: 'JavaScript example', }, + { + type: 'link', + label: 'GitHub', + href: 'https://github.com/adobe/trustmark/', + }, ], }, ],