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 🙏

© 2026 – Pkg Stats / Ryan Hefner

text-over-image-cli

v0.0.5

Published

A cli to create text overlay image format

Readme

Text Over Image (toi) CLI

A powerful, lightweight CLI tool to overlay text on images with automatic scaling, wrapping, and smart resizing.

Features

  • Universal Input: Supports both local file paths and remote URLs.
  • Smart Resizing: Upscale or downscale images while maintaining aspect ratios (e.g., 16:9, 4:3).
  • Auto-Wrapping: Automatically wraps long text into multiple lines based on image width.
  • Relative Scaling: Font sizes are relative to image height by default, ensuring consistency across different resolutions.
  • Precise Positioning: Use keywords (top, center, bottom) or pixel offsets (positive/negative).
  • EXIF Awareness: Automatically handles image rotation based on EXIF metadata.
  • High Readability: Renders white text with a black outline for visibility on any background.

Installation

Install the package via npm:

npm install -g text-over-image-cli

Or run it directly using npx:

npx text-over-image-cli -f <image> -t "Your Message" -p <position>

Usage

toi -f <image> -t "Your Message" [options]

Required Arguments

| Flag | Name | Description | | :--- | :------- | :------------------------------------------- | | -f | --file | Path to a local image or a URL (http/https). | | -t | --text | The text message to overlay. |

Optional Arguments

| Flag | Name | Description | | :--- | :------------ | :----------------------------------------------------------------------- | | -p | --position | Vertical alignment: top, center, bottom, or a number. Default: center. | | | --width | Force a specific width in pixels. | | | --height | Force a specific height in pixels. | | | --aspect | Target aspect ratio (e.g., 16:9, 1:1). | | -s | --font-size | Custom size in pixels (40) or percentage (5%). Default: 4%. | | -r | --preset | Apply a specific style preset (e.g., "snapchat"). | | -b | --text-background | Custom background color for the text bar (e.g., "red"). | | -o | --output | Destination path. Default: a unique temporary file. | | | --history | Show recent history of generated images. | | -h | --help | Show the detailed help menu. |


Examples

1. Basic Local Image

Add a centered message to a local photo (defaults to center):

toi -f photo.jpg -t "Hello World"

2. Snapchat Style Overlay

Apply the semi-transparent background bar style:

toi -f photo.jpg -t "Sunday Vibes" --preset snapchat

3. Custom Background Color

Manually add a red background bar to your text:

toi -f photo.jpg -t "Warning" -b "rgba(255, 0, 0, 0.6)"

4. Overriding a Preset

Use the snapchat preset but override its default background with a solid black one:

toi -f photo.jpg -t "Deep Text" --preset snapchat -b "black"

5. Remote URL with Bottom Offset

Fetch an image from the web and place text 50px from the bottom:

toi -f https://picsum.photos/800/600 -t "Adventure Awaits" -p -50 -o travel.jpg

3. Creating a 16:9 Banner

Resize any image to 1920px wide with a 16:9 aspect ratio and large text:

toi -f input.png -t "Header" -p center --width 1920 --aspect 16:9 -s 8% -o banner.jpg

4. Custom Font Size (Pixels)

toi -f bg.png -t "Small Print" -p top -s 20

5. View Activity History

toi --history

Development

Type Checking

bun x tsc --noEmit

Build

bun run build

License

MIT © ahm0xc