Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andormade/img2teletext
Converts images to teletext 🖼️ ➡️ 📺
https://github.com/andormade/img2teletext
nodejs teletext
Last synced: 9 days ago
JSON representation
Converts images to teletext 🖼️ ➡️ 📺
- Host: GitHub
- URL: https://github.com/andormade/img2teletext
- Owner: andormade
- License: mit
- Created: 2016-05-18T19:41:26.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T08:03:27.000Z (almost 2 years ago)
- Last Synced: 2024-10-08T14:12:21.047Z (about 1 month ago)
- Topics: nodejs, teletext
- Language: JavaScript
- Homepage:
- Size: 1.13 MB
- Stars: 9
- Watchers: 4
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# img2teletext
This is a CLI application for converting images to teletext level 1 compatible data. Starting from the upper leftmost, the algorithm goes by 2x3 blocks of pixels, and translates them to teletext mosaic charachters. It can also be used as a Node.js library.
![poes]
[poes]: poes.gif
It handles images of any dimensions, they don't have to be within the constraints of a standard teletext page.
## Requirements
- node v8 or older (It probably works with older versions as well, but I haven't tested it on anything older than v8.9.0.)
- npm v5 or older (It comes with node.)## Installation
This module is distributed via both npm and yarn.
$ npm install img2teletext --g
## Command line example
$ img2teletext ./test/test.png --out teletextData.bin
## Using it as a Node.js library
const img2teletext = require('img2teletext');
const { PNG } = require('pngjs');
const fs = require('fs');const data = fs.readFileSync('./test/test.png');
const png = PNG.sync.read(data);
const teletextData = img2teletext(png.data, png.width);console.log(teletextData);
This code is released under the MIT license, feel free to do whatever you want with it.