{"slug": "i-marked-a-png-for-the-eu-ai-act-then-re-encoded-it-the-mark-was-gone", "title": "I marked a PNG for the EU AI Act, then re-encoded it. The mark was gone.", "summary": "A developer built a stdlib-only Python marker that embeds an XMP packet with the IPTC digital source type trainedAlgorithmicMedia into JPEG and PNG files, plus a sha256-bound JSON sidecar for formats that cannot safely hold metadata, to meet EU AI Act Article 50(2) machine-readable marking requirements. Testing on real files showed the embedded XMP mark survived read-back but was stripped by a routine CMS-style re-encode that dropped non-critical chunks, while the sidecar approach detected any single-byte change. The developer notes the marking transition runs to 2 December 2026 for systems placed on the market before 2 August 2026.", "body_md": "I spent last week on a problem that sounds small until you have to prove it in an audit. Article 50(2) of the EU AI Act requires providers of generative systems to mark synthetic audio, image, video and text outputs in a **machine-readable** format. Not a caption. Not a terms-of-service line. A mark a crawler or a downstream auditor can detect without reading prose.\n\nThe marking transition runs to **2 December 2026** for systems placed on the market before 2 August 2026. If you are on that list and you ship images, that is about eleven days away.\n\nI wrote a small stdlib-only marker that embeds an XMP packet carrying the IPTC digital source type `trainedAlgorithmicMedia` - APP1 for JPEG, an `iTXt` chunk for PNG - and a sha256-bound sidecar for formats you cannot safely write metadata into. Then I ran the four checks that matter, on real files, and wrote the results down.\n\n**1. Mark a PNG, then read it back.**\n\n``` php\n$ python marking.py mark src.png marked.png\nMARKED src.png -> marked.png (887 bytes)\n$ python marking.py verify marked.png\nMARKED (embedded-xmp): marked.png   # exit 0\n```\n\nThe mark is in the file, CRC-correct, and any XMP-aware tool can read it.\n\n**2. Re-encode the PNG the way a CMS would.**\n\nThis is where it stopped being theoretical. I decoded the marked PNG and re-wrote it without the non-critical chunks - the same thing a thumbnailer, a CDN or a social platform does to an upload:\n\n``` bash\n$ python marking.py verify reencoded.png\nNOT MARKED (embedded-xmp): reencoded.png   # exit 1\n```\n\nThe picture is identical. The mark is gone. A metadata mark is only as robust as the platform that carries it, and most platforms do not carry it. If your evidence plan is \"we embedded XMP\", the next question is \"survived what?\", and the honest answer is usually \"nothing that re-encodes\".\n\n**3. The sidecar path, and the tamper check.**\n\nFor text, audio, video and anything you cannot write metadata into, the marker writes `<file>.art50.json`: the IPTC source type plus the file's sha256. That is a different property. It is not a mark *in* the file, it is a claim *about* the file, bound to its exact bytes.\n\n``` bash\n$ python marking.py sidecar doc.txt\nSIDECAR doc.txt.art50.json verify=True\n$ python marking.py verify doc.txt\nMARKED (sidecar): doc.txt   # exit 0\n# change one byte\n$ python marking.py verify doc.txt\nNOT MARKED (sidecar): doc.txt   # exit 1\n```\n\nThat is the check I would put in a pipeline. The sidecar tells you the file is the file you marked, and it tells you the instant it is not.\n\n**4. Re-marking does not stack.**\n\nRe-running the marker replaces the previous packet rather than appending a second one. It matters because a duplicated packet is the sort of thing that makes an auditor ask how many times this file passed through your pipeline. It is a small detail and it is acceptance-tested.\n\nThe article draws a line between two duty holders, and the two are not the same team:\n\nIf you wrap, fine-tune, host or resell a model, you are very likely a provider of the wrapped system even when the base model carries someone else's name. That is the planning error worth checking first, because it changes which duty lands on you.\n\n`verify`. If the mark does not survive, that is a finding, not a detail.\nThe first three are free and take an afternoon. The fourth is what an auditor asks for.\n\nI maintain a small **Art. 50(2) Marking Readiness Pack** - the marker, a self-audit checklist mapped to the four statutory properties (effective, interoperable, robust, reliable) and a deployer disclosure template: [https://derbaroser-eng.github.io/art50-marking/](https://derbaroser-eng.github.io/art50-marking/) (EUR 29).\n\nIf you need the operative wording of 50(1) to 50(5) next to the definitions, a provider/deployer duty map, the deadline table and an audit-trail template, I also produce a one-page **Art. 50(2) Evidence Report** for a specific pipeline: [https://derbaroser-eng.github.io/art50-conform/](https://derbaroser-eng.github.io/art50-conform/) (EUR 490, one pipeline per report).\n\nBoth are engineering aids, not legal advice, and neither is a conformity certificate. Legal conclusions about your obligations stay with qualified counsel.\n\nIf you do one thing this week: run steps 1 and 2 on your own roadmap, then re-encode one of your own marked outputs and run `verify`. The result is worth more than the good intentions.\n\n*This post was drafted with AI assistance and reviewed by a human before publication.*", "url": "https://wpnews.pro/news/i-marked-a-png-for-the-eu-ai-act-then-re-encoded-it-the-mark-was-gone", "canonical_source": "https://dev.to/aurum_revenue/i-marked-a-png-for-the-eu-ai-act-then-re-encoded-it-the-mark-was-gone-2m82", "published_at": "2026-11-21 18:09:38+00:00", "updated_at": "2026-11-21 18:12:09.792626+00:00", "lang": "en", "topics": ["ai-policy", "generative-ai", "ai-safety"], "entities": ["EU", "IPTC", "derbaroser-eng"], "also_reported_by": [], "takeaway": null, "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/i-marked-a-png-for-the-eu-ai-act-then-re-encoded-it-the-mark-was-gone", "markdown": "https://wpnews.pro/news/i-marked-a-png-for-the-eu-ai-act-then-re-encoded-it-the-mark-was-gone.md", "text": "https://wpnews.pro/news/i-marked-a-png-for-the-eu-ai-act-then-re-encoded-it-the-mark-was-gone.txt", "jsonld": "https://wpnews.pro/news/i-marked-a-png-for-the-eu-ai-act-then-re-encoded-it-the-mark-was-gone.jsonld"}}