{
"$type": "site.standard.document",
"content": "---\ntitle: \"Redacting craiyon prompts with imagemagick\"\ndescription: \"A one-liner ImageMagick command to batch-redact the prompt text from craiyon\n (DALL-E mini) screenshot outputs.\"\ntags:\n - dev\n - ai\n---\n\nI've been messing around with [craiyon](https://www.craiyon.com) (formerly\n[DALL-E mini](https://huggingface.co/spaces/dalle-mini/dalle-mini)), because who\n_hasn't_ been doing that recently.\n\nAs part of a workshop I'm running soon at the\n[School of Cybernetics](https://cybernetics.anu.edu.au) I need to provide\n\"redacted\" versions of the classic 3x3 craiyon output image---and I need to do\nit for quite a few outputs.\n\nBecause it's tedious to do that by hand, here's what I came up with:\n\n1. input a prompt and generate the craiyon output as normal\n\n2. use the _📷 Screenshot_ button to get a nice, clean screenshot\n\n3. run this [imagemagick](https://imagemagick.org) command (in my case the\n downloaded screenshot name was `craiyon_2022-6-22_17-21-5.webp`, yours will\n be similar but with a different timestamp at the end)\n\n ```sh\n convert craiyon_2022-6-22_17-21-5.webp -fill red -draw 'rectangle 30, 240, 1320, 320' -fill white -pointsize 50 -gravity north -annotate +0+250 'REDACTED' craiyon_2022-6-22_17-21-5-redacted.webp\n ```\n\n4. (bonus round) if you want to loop over a bunch of files and do it in batch, I\n did that in Emacs with:\n ```lisp\n (--each\n (f-entries \".\" (lambda (s) (s-ends-with? \"png\" s)))\n (shell-command (format \"convert %s -fill red -draw 'rectangle 30, 240, 1320, 320' -fill white -pointsize 50 -gravity north -annotate +0+250 'REDACTED' redacted-%s.webp\"\n it\n (f-base it))))\n ```\n\n## An example\n\nHere's an example screenshot:\n\n\n\nand the same output, after the redaction command has been run:\n\n\n\nIf you need to do the same, then hopefully I've saved you a bit of time ☺\n",
"createdAt": "2026-05-13T23:14:48.896Z",
"description": "A one-liner ImageMagick command to batch-redact the prompt text from craiyon (DALL-E mini) screenshot outputs.",
"path": "/blog/2022/06/22/redacting-craiyon-prompts-with-imagemagick",
"publishedAt": "2022-06-22T00:00:00.000Z",
"site": "at://did:plc:tevykrhi4kibtsipzci76d76/site.standard.publication/self",
"tags": [
"dev",
"ai"
],
"textContent": "A one-liner ImageMagick command to batch-redact the prompt text from craiyon (DALL-E mini) screenshot outputs.",
"title": "Redacting craiyon prompts with imagemagick"
}