C3 Logo

C3 Codes - Quick Commands:

Logo - C3 Code

Home | C3 Format | PDF Format | Quick Commands


WARNING: Please make sure you run these commands in a newly created empty folder, otherwise you could end up deleting personal files. You have been warned!


To create a C3 Code from "message.txt": (output is "composite.png")

split -n 3 message.txt && cat xaa | qrencode -o 0.png && cat xab | qrencode -o 1.png && cat xac | qrencode -o 2.png && convert 0.png 1.png 2.png -combine composite.png && rm xaa xab xac 0.png 1.png 2.png



To decode a C3 Code named "composite.png": (output is "message.txt")

convert composite.png -separate 0.png && zbarimg -Sdisable -Sqrcode.enable --raw 0-0.png | head -c-1 >> message.txt && zbarimg -Sdisable -Sqrcode.enable --raw 0-1.png | head -c-1 >> message.txt && zbarimg -Sdisable -Sqrcode.enable --raw 0-2.png | head -c-1 >> message.txt && rm 0-0.png 0-1.png 0-2.png



To decode a C3 Code from a photo you have taken, named "composite.jpg": (output is "message.txt")

convert composite.jpg -resize 600 shrunk_composite.png && convert shrunk_composite.png -separate 0.png && zbarimg -Sdisable -Sqrcode.enable --raw 0-0.png | head -c-1 >> message.txt && zbarimg -Sdisable -Sqrcode.enable --raw 0-1.png | head -c-1 >> message.txt && zbarimg -Sdisable -Sqrcode.enable --raw 0-2.png | head -c-1 >> message.txt && rm shrunk_composite.png 0-0.png 0-1.png 0-2.png



To create a Collated C3 Code image file from "message.txt": (output is "collated_composite.gif")
(Try increasing the "split -n 4" parameter if you get errors.)

split -n 4 -d -a 6 message.txt && for f in x*; do split -n 3 -d -a 1 "$f" "y$f-"; done && for g in y*; do cat "$g" | qrencode -8 -o "z$g.png"; done && rm y* && for f in x*; do convert "zy$f-0.png" "zy$f-1.png" "zy$f-2.png" -combine "c$f.png"; done && rm x* z* && convert -delay 100 cx*.png -loop 0 collated_composite.gif && rm cx*.png



To decode a Collated C3 Code image file named "collated_composite.gif": (output is "message.txt")

convert collated_composite.gif -separate output-%06d.png && for i in output-*.png; do zbarimg -Sdisable -Sqrcode.enable --raw $i | head -c-1 >> message.txt; done && rm output-*.png



Project hosted by ourproject.org.
Banner ourproject.org 88x31 pixels     
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Creative Commons Licence