npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

text-ttr

v1.0.2

Published

Creates illusion image that can only be read when you tilt your screen.

Downloads

21

Readme

TextTTR

NodeJS library that creates illusion image that can only be read when you tilt your screen

Installation

Note

  • It uses node-gd as dependency, and node-gd require libgd that currently doesn't supports windows systems.

On Debian/Ubuntu

$ sudo apt-get install libgd-dev
$ npm i text-ttr

On RHEL/CentOS

$ sudo yum install gd-devel
$ npm i text-ttr

On Mac OS/X

Using Homebrew

$ brew install pkg-config gd
$ npm i text-ttr

On Mac OS/X

...or using MacPorts

$ sudo port install pkgconfig gd2
$ npm i text-ttr

Windows

  • I am not sure, but if there is some method to install libgd on windows then it would work fine on windows too.

Usage

Simple usage

const textTTR = require("text-ttr");
let img = textTTR({ text1: "TextTTR"})); // returns base64 image
console.log(img); // data:image/png;base64,iVBORw0KGgoAAAANSUhEU...

Advanced Usage

const textTTR = require("text-ttr");
let img = textTTR({
  text1: "TextTTR",
  text2: "Illusion",
  type: "png",
  bgColor: "#000",
  textColor: "#f00",
}); // return randomly generated image name
console.log(img); // file_name.png

OR

const textTTR = require("text-ttr");
let img = textTTR({
  text1: "TextTTR",
  text2: "Illusion",
  type: "png",
  bgColor: "#000",
  textColor: "#f00",
  file: "my_illusion_image.png",
}); // return filename i.e. my_illusion_image.png
console.log(img); // my_illusion_image.png

API

textTTR(options);

Options

text1 (Required) : Primary text written on image. text2 (Optional) : Secondary text written on image. type (Optional) : Type of image output. It can contain two values i.e. "b64" or "png". (Default: "b64") bgColor (Optional) : Background color of image. Hex color string can be passed. (Default: "#ffffff") textColor (Optional) : Text color written on image. Hex color string can be passed. (Default: "#000000") file (Optional) : Specify the output image full path when type:"png" is passed. (Example, file: "path/to/any/folder/illusion.png"). If you do not pass this when type:"png" then the ouput image automatically created with some random name in current folder.

Misc

Any contribution on this library will be appreciated. If you have any feature idea related to this library or you are facing any issue, then just create issue on github and I will try to fix it soon.