HI version is available. Content is displayed in original English for accuracy.
Advertisement
Advertisement
⚡ Community Insights
Discussion Sentiment
78% Positive
Analyzed from 2561 words in the discussion.
Trending Topics
#shirt#ocr#code#https#text#com#bash#here#script#llm

Discussion (102 Comments)Read Original on HackerNews
Imagine having to return a t-shirt because that malfunction!
— I don't understand why are you returning this, was the size wrong or you didn't like it?
— No, there is a syntax error at line 37 that makes it impossible to run, and I'm concerned people on the street may think I promote unsafe bash scripting.
I think though it could likely be easily OCR'd if you give the image to any decent agentic harness with a good vision model, e.g. newest Claude/GPT ones, and tell them to split the image per lines, and then just OCR each line individually.
I wonder if the script itself was written by an LLM before obfuscation? There seem to be a lot of comments in it, but in this case it's still ok :)
The congratulations text is both in English and Japanese. Contains a single heart emoji.
There was an intention to have a cyan to orange gradient, but the range starts in an ANSI block, ends halfway through the 256 color block and 256 terminal colors are not arranged like a gradient at all.
There's no sleep at the end of the loop where I feel like an LLM would add that defensively.
In my mind an AI would do something the most popular way even when that's not appropriate.
A human might do things in an unpopular way even when that's not appropriate.
I wonder what it's doing under the hood to get such good performance?
Looked it up, you put mouse over text, then just select and copy it - very cool!
https://support.apple.com/en-gb/guide/safari/ibrw20183ad7/ma...
On meetings I will often take a screenshot of the URL someone is presenting. I’m then able to just open the image and click the URL in the image.
Preview has pretty good background removal.
Notes will transcribe audio from audio files.
From the prototype shown here [0], and the way they talk about their process, I sincerely doubt it. Especially as they mention trying to make it hard for AI to handle the output.
[0] https://youtu.be/jocGLiecpjU?t=567
What made me wonder, personally, was that the output seems identical if you use "♥PEACE♥FOR♥ALL" instead of the version with internal repeats. IF there is any point to that "manual expansion of the cycles", IMO that deserves a comment much more so than "# Calculate length of text; text_length=".
Also, that `echo -n ...` followed by `echo ""` instead of just plain `echo` in the first place seems like the kind of copy-pasta code LLMs generate. Then again, regular devs also write pretty bad copy-pasta code.
There is also this the weirdly "broken down" calculation with 3 `bc` invocations not 1 as if it was translated from a language with more arithmetic/special function power than bash.
There is also the color scale stuff done in the loop instead of outside (except the one color=$(..)) which seems very unnatural and also very like machine translation.
Also, at least for me, on my bash-5.3.15(1), `char="${text:t % text_length:1}"` does not work to slice out the multi-byte UTF8 heart symbols, but it sure does look like the kind of thing an LLM would do translating from a python3 script (such as something like https://news.ycombinator.com/item?id=48830669) into bash.
Another thing is, as others here have observed, there is nothing "gradual" about the xterm-256 color cube. So, "gradient" is a misnomer and exactly the kind of weird things LLMs do when they cobble text together.
Finally, all the tput stuff the script does instead of just "print x spaces" really smells like a human description of the side scroll in the video game graphic he shows inspired him somehow LLM-corrupted/complexified into the vertical scroll terminals do, but with a lot of extraneous complexity.
None of this is conclusive, but the video mentions 2023..2025 as when he did it and given that he was a designer and his concerns more visual than code-oriented, I'd have to say I disagree with your sincere doubt and I do strongly suspect the decoded script was very likely LLM-circa2024-generated, possibly with light post-edits.
The AI not handling the output relates to the final base64 output on the T-shirt (which other comments in this thread mention manually keying in or TFA discusses in the context of OCR). So, that is just not relevant to the question.
Can't remember his name now, there's been so many distractions...
I seem to recall seeing an Akamai-branded base64'd shell script on a white shirt pre-2021(?), so unless they've changed the code since then, I doubt it...
My code usually clocs at 50/50 (or thereabouts)[0]. Has, since my very first real engineering project (in 1987)[1]. I discuss in detail, here[2].
But one reason that I like LLMs, is that they help me to write even more documentation. I have found that I can instruct an LLM to revise my documentation, and make it even more effective.
[0] https://github.com/ChrisMarshallNY (My GH profile. Pretty much everything there, is like that -has, since long before LLMs were a broken rubber on the drug store shelf).
[1] https://littlegreenviper.com/wp-content/uploads/2022/07/TF30... (Downloads a PDF)
[2] https://littlegreenviper.com/leaving-a-legacy/
Especially in a case like this, I would definitely write a lot of comments to aid in understanding, thus increasing trust so people would try it out and tinker with it.
The comments can be more cute/awe inspiring for people who aren't as familiar with bash but like solving puzzles as well.
Upon seeing this, I decided to golf and came up with a shorter version:
[0] https://github.com/GL-Kageyama/UNIQLO_Akamai_T-shirt_Code
Basically it just clusters same characters and asks the human to find the problems, which is easy when you're looking at a series of pictures like ssssss5sss.
The UI is kinda least-effort. Should ask a modern AI agent to make it look nice and intuitive, sometime maybe.
All in, you should have a non-corrupted string in 10-15 min.
IDK what the author was using but I feel like he could have shared how his OCR attempt went, but I am thinking he tried some naive OCR tools.
> May the m×s/t² be with you
Surely this would use whatever font the virtual terminal profile was set to? I don’t know of any method to choose a virtual terminal font from bash and don’t see any code that addresses it?
Might have to do something like that for a verse on the next Carolina Code Conference shirt. Been trying to figure out a good way to pull in cybersecurity.
It’s a movie plot.
That's better than half the tech howtos out there.
The old one was: https://www.uniqlo.com/us/en/products/E459561-000/00
The guy who founded the new political party Team Mirai also wears it frequently: https://en.wikipedia.org/wiki/Takahiro_Anno
https://www.wired.com/2000/08/court-to-address-decss-t-shirt...
Very wow. Shame they assumed everyone has "bc"...
I bet 10$ I'd spend less time typing it from the t-shirt. And I wouldn't boil two kettles of water in the process.
But hey, AI makes you 10x more productive, I suppose
My bet is against manual OCR with various engines + finding mistakes later using an LLM.