Posted: . At: 9:05 AM. This was 3 years ago. Post ID: 15353
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.

A very cool Linux trick. Read the time in the terminal from an image.

This is a very cool Linux one-liner, this is using the Tesseract OCR engine to read an image generated by a script and then read the time from it.

┌──[jason@192.168.1.2][~/Pictures/letter]
└──╼  ╼ $ curl -s 'https://securitronlinux.com/api/servers.php' -o - | tesseract stdin stdout --dpi 150 | grep --color CDT
05:33:13pm Sun Aug 22, 2021 CDT

This is a very good trick to perform.

This is another example.

┌──[jason@192.168.1.2][~/Pictures/letter]
└──╼  ╼ $ curl -s 'https://i.4cdn.org/g/1629669083723.jpg' -o - | tesseract stdin stdout --dpi 150 | grep --color Zorin
Zorin OS

And yet another working example.

┌──[jason@192.168.1.2][~/Pictures/letter]
└──╼  ╼ $ curl -s 'https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png' -o - | tesseract stdin stdout --dpi 92 | grep --color Google
Google

This could be a neat trick to have in a script, if you find an image that has text you want, you could extract it and then use it for something.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.