Yusuke Endoh Piet quine is a small GIF that Endoh says is both an executable program and the exact file that program produces. In a July 31 video and accompanying post, Endoh demonstrated a 252-by-189-pixel image written in Piet, an esoteric programming language whose source code is an image. He says that running the GIF outputs that same GIF, byte for byte.
The claim is documented in Endoh’s video demonstration, which links to code and a generator, though the available material does not include an independent execution of the artifact. The point is less a useful image format feature than a tightly constrained exercise in self-reference.
What is Yusuke Endoh’s Piet quine?
A quine is a program whose complete output is its own source code, without taking external input or reading its own source file. The standard is deliberately strict: a program that opens its file and sends its contents to the screen has dodged the puzzle rather than solved it.
Piet changes the shape of that puzzle. Its programs are colored tiled images rather than lines of text, according to Tom’s Hardware. An interpreter reads the visual arrangement as instructions. In Endoh’s case, the GIF is therefore the program source, while the intended output is the identical GIF file.
That requirement puts more on the program than producing a visual lookalike. A byte-exact GIF must reproduce the file’s binary structure. Endoh’s video breaks the process into five stages: loading data, producing the GIF header and palette, drawing the data portion, drawing the code portion, then adding the trailer and halting.
Why is a self-printing GIF harder than a text quine?
Text quines already have to account for their own quotes, formatting and instructions. A GIF quine also has to reconstruct image-file components that a conventional text program does not face, including binary data and compression. Tom’s Hardware reported that Endoh’s image separates data and code, with the data portion using adaptive run-length encoding.
Endoh told the publication that he had made an earlier version in 2009, but it was too tall for easy viewing. The reported redesign used Claude Code to analyze and reconstruct the earlier script before Endoh refined it into the current 4:3 image. That account is Endoh’s reported description of the development process, rather than an independent technical audit.
Endoh also said the work was meant to draw attention to the 2026 Obfuscated Programming Language Design Contest, where he is a judge. Tom’s Hardware reported an October 1 submission deadline, without stating the year alongside that date.
This story draws on original reporting from Tom's Hardware.