Text Images

From Publication Station
Revision as of 15:46, 17 January 2018 by Andre (talk | contribs)

Text Images

Group: WDK17-MHP-El2

Dates: 22Jan-2Feb. Tuesday - Friday. 13:00-16:00.

Room: BL-1.3


Description

The following elective will be based on the project Excelfie by design Lucia Dossin, where selfie (images), captured by a digital camera are converted onto plain-text files (ASCII-art). In these text-based images, the sequence of pixels of the captured images is mapped onto corresponding text characters, in order to create text-based rendition of the original bit map image.

3excelfie-derivation1.png
Excelfie at Zinecamp 2017

Announcement text

What are digital (bit-map) images? In their simpler form nothing more but sequence of pixels, each with its color value, organized into lines and rows. Such form of representing image information is uncannily similar to how text is represented digitally: a line-by-line sequence of characters, each with its corresponding value (code point). Can this similarity be used to transform pixel-based images into similar looking images made solely by text? And what happens when we reverse the process and try to get the text-based images into pixels using Optical Character Recognition software?


Material

We will work towards the implementation of the Excelfie in the Publication Station, for which we'll use:

  • raspberry Pi
  • camera (webcam)
  • LCD screen (HDMI input)
  • headphones
  • typewriter


Raspberry Pi software

  • Ascii art: figlet cowsay
  • imaging: imagemagick fbi hasciicam
  • audio: espeak
  • editor: nano

Organization

Keyboard and encoding

ASCII Art

  • ASCII & Plain text
    • origins of ASCII encoding
    • previous encodings
    • current encoding: Unicode
Plain-text files Binary files
Each byte (8bits sequence) represents one ASCII character there is no one-to-one mapping between bytes and characters
Do not include any formatting information: only text Can have all sorts of formatting, like a Word doc, PDF, or image
are read/written with plain-text editors; or less cat commands data can be interpreted by supporting programs, but will show up as garbled text in a text need specific applications, depending on the file, i.e. Word for .doc. PDF-viewer for PDF
Are less likely to become corrupted, a small error shows up as a typo A small error may make it unreadable
common file formats: ?? common file formats: ??

Can we have an bit-map stored in a plain-text file?


[https://en.wikipedia.org/wiki/X_PixMap

X PixMap (.xpm)] is a plain-text file, 

intended primarily for creating icon pixmaps


What can be done with X PixMap?

  • ASCII Art


Typewriter Art

    • vitality of type writer art

Difference between plain-text and binary

Bit maps:

  • sequences of pixels
  • resolution
  • color depth: conversions
  • Plain-text image bit map: .xpm

Software:

  • imagemagick: convert resolution, color depth, format
  • fbi: Fbi (frame-buffer image) displays the specified file(s) on the linux console using the framebuffer device


{{#widget:Youtube|id=UBX2QQHlQ_I}}

Capturing image

  • fswebcam/xawtv: capture camera

fswebcam: no visual feedback

fswebcam --device  /dev/video0 --no-banner --save test.jpg

mpv: screen shot by typing "s"

mpv /dev/video0

ASCII

ASCII encoding

  • Previous encoding schemes: Baudot code
  • Ascii table: printing and non-printing characters
  • 7-bits in 8-bit bytes


Links:

http://worldpowersystems.com/J/codes/baudot.GIF

ASCII Art

ASCII art is text art created with ASCII, a protocol established by the American National Standards Institute (ANSI), which is America's representative to the International Organization for Standardization (IOS). ASCII art uses ASCII text characters to produce images. The emoticon, an element of text messaging and email, is an example of ASCII art at its most popular and functional. [1]

Ascii Art as an idea coalesced into existence bceause people

wanted more. They wanted more than just your standard Hercules display Atari or your Monochrome Commodore 64. To meet this demand, one singular artist, whose name is lost to the annals of history decided to take the plunge. Instead of text, he (or she) had the ingenuity to use the characters /, \, |, -, _ and whatever else came to mind to create words. An amazing idea. [2]


ascii-art software

Exercises: using the command line tools create several ASCII art "images". Send them to other users, save it to files, print it (dot-matrix).

  • figlet - display large characters made up of ordinary screen characters
  • cowsay - cowsay/cowthink - configurable speaking/thinking cow
  • jp2a - convert JPEG images to ASCII


Typewriter Art

A vibrant area of graphic exploration.

A predecessor of ASCII

Typewritermanual.jpg Newspaper.jpeg

Bit maps

Exercise: Use imagemagick to convert a binary bitmap (jpg or png) to a plain text bitmap (.xpm) under different color depths

bit maps: sequences of pixels

<ref>Bourke, Paul. n.d. ‘A Beginners Guide to Bitmaps’. Accessed 2 January 2018. http://paulbourke.net/dataformats/bitmaps/.<ref>

color depths

    • 1-bit color (2 colors): monochrome, often black and white,
    • 2-bit color (4 colors)
    • 3-bit color (8 colors)
    • 4-bit color (16 colors)
    • 5-bit color (32 colors)
    • 6-bit color (64 colors)
    • 8-bit color (256 colors)
    • 8-bit greyscale (256 grey colors): each pixel represents only an amount of light (intensity information)
    • 12-bit color (4096 colors):
    • 24-bit True color (16777216 colors): 256 shades of each color channel red, green, and blue

plain-text image formats

    • X PixMap (.xpm)
    • NetPBM
      • Portable BitMap[1] P1 P4 .pbm 0–1 (white & black)
      • Portable GrayMap[2] P2 P5 .pgm 0–255 (gray scale)
      • Portable PixMap[3] P3 P6 .ppm 0–255 (RGB)


Capturing camera input

Assembling it all

Pi cheat sheet

display image in Terminal 1 with

fbi capture.jpg -T 1

display video with oxmplayer

oxmplayer http://oooooooooo.io/images/2/21/RF-enblanco-1.mp4


picam; but Picam seems difficult to work with other software - should try webcam

raspistill -o test.jpg 

There is a python module for it: https://pzwiki.wdka.nl/mediadesign/PiCam


references

  1. ‘ASCII ART’. n.d. Accessed 2 January 2018. http://artscene.textfiles.com/information/ascii-newmedia.txt
  2. Necromancer. 1998. ‘History of the PC Ascii Scene’. March 1998. http://artscene.textfiles.com/history/essays/pcascii.txt

Cosic, Vuk ‘3D ASCII, An Autobiography’ http://www.ljudmila.org/~vuk/ascii/vuk_eng.htm

‘Ascii vs. Binary Files’. n.d. Accessed 2 January 2018. https://www.cs.umd.edu/class/sum2003/cmsc311/Notes/BitOp/asciiBin.html.

Borzyskowski, George. n.d. ‘THE HACKER DEMO SCENE AND IT’S CULTURAL ARTIFACTS’. Accessed 2 January 2018. http://artscene.textfiles.com/history/essays/borzysko.txt.


‘Digital Art Guild - Portait of the Artist as a Young Scientist by Ken Knowlton’. n.d. Accessed 2 January 2018. http://www.digitalartguild.com/content/view/26/26/.

Ippgi. n.d. ‘History of the Scene: The Beginnings of the IBM-PC Underground’. Accessed 2 January 2018. http://artscene.textfiles.com/information/history.html.

Thomas, Matthew. n.d. ‘Welcome to Ascii-Art’. Accessed 2 January 2018. http://artscene.textfiles.com/information/faq-altasciiart.txt.