text-pngify
Convert text to pixels and save to png file.
hello world.png
I Have a Dream.png
Install
npm i -s text-pngify
Usage
encode
const encode = ; // encode String => Uint8Array(PNG) let u8a = ;// Uint8Array(80) [// 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13,// 73, 72, 68, 82, 0, 0, 0, 2, 0, 0, 0, 2,// 8, 6, 0, 0, 0, 114, 182, 13, 36, 0, 0, 0,// 23, 73, 68, 65, 84, 120, 94, 99, 200, 72, 205, 201,// 201, 87, 40, 207, 103, 40, 202, 73, 97, 0, 1, 0,// 50, 248, 4, 93, 192, 177, 254, 97, 0, 0, 0, 0,// 73, 69, 78, 68, 174, 66, 96, 130// ] // toFile // toBase64Buffer// iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAF0lEQVR4XmPISM3JyVcoz2coyklhAAEAMvgEXcCx/mEAAAAASUVORK5CYII=
decode
const decode = ; // decode Uint8Array(PNG) => String //fromFilelet text = // "hello world" //fromBase64// "hello world"