What would "Hello, Stata!" look like as a picture? 
The attached PNG stores 13 text bytes as grayscale tiles, with RGB=(b,b,b) for each byte b. An experimental user-written command, pngread, reads the pixels entirely in Stata/Mata. A short example recovers the greeting and saves it as text. This is an encoding experiment, not OCR.
Source, help, and examples: Speak-Read-Write-Listening-Stata on GitHub.
In a scratch folder and session, try the following. The example replaces data in memory and writes hello_stata_decoded.txt.
Expected text:
Optional speech on macOS, using the recovered file:
To create the picture yourself, run do make_hello_stata.do. PNG reading uses only Stata/Mata; speech uses the macOS speech service. Tested with Stata/MP 16.1 on macOS. The reader currently supports 8-bit, noninterlaced PNGs; other systems are not yet validated.
The package includes the original PNG. To test the forum attachment itself, save it as hello_stata.png in the current folder before running the example; that local file takes priority. Keep the original 624 x 160 pixels: no resizing or screenshot.
Does it recover the greeting on your system? Please mention your Stata version and operating system if you try it.
The attached PNG stores 13 text bytes as grayscale tiles, with RGB=(b,b,b) for each byte b. An experimental user-written command, pngread, reads the pixels entirely in Stata/Mata. A short example recovers the greeting and saves it as text. This is an encoding experiment, not OCR.
Source, help, and examples: Speak-Read-Write-Listening-Stata on GitHub.
In a scratch folder and session, try the following. The example replaces data in memory and writes hello_stata_decoded.txt.
Code:
local source "https://raw.githubusercontent.com/renegade68/Speak-Read-Write-Listening-Stata/main"
net install pngread, from("`source'")
net get pngread, from("`source'")
do read_hello_stata.do
Code:
Hello, Stata!
Code:
shell /usr/bin/say -f "hello_stata_decoded.txt"
The package includes the original PNG. To test the forum attachment itself, save it as hello_stata.png in the current folder before running the example; that local file takes priority. Keep the original 624 x 160 pixels: no resizing or screenshot.
Does it recover the greeting on your system? Please mention your Stata version and operating system if you try it.

Comment