Skip to content

A simple Node.js tool that turns binary strings into black-and-white images. Pick the image size, scale the pixels, and generate every possible combination.

License

Notifications You must be signed in to change notification settings

jaganganesh/pixel-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pixel Generator

A simple Node.js tool that turns binary strings into black-and-white images. Pick the image size, scale the pixels, and generate every possible combination.

Features

  • Convert any binary string 0010 into a black-and-white image
  • Supports arbitrary width × height grids
  • Scale pixels to make images bigger (e.g., 100×100 per logical pixel)
  • Bulk generation of all combinations (perfect for 2×2, 3×3, etc.)

Sample

Binary 0000 Binary 0001 Binary 0010 Binary 0011
Binary 0100 Binary 0101 Binary 0110 Binary 0111
Binary 1000 Binary 1001 Binary 1010 Binary 1011
Binary 1100 Binary 1101 Binary 1110 Binary 1111

Installation

npm install canvas

Usage

Import the function

const { binaryToImage } = require("./binaryToImage");

Generate an Image

binaryToImage("1001", 2, 2, "output.jpg", 32);

About

A simple Node.js tool that turns binary strings into black-and-white images. Pick the image size, scale the pixels, and generate every possible combination.

Topics

Resources

License

Stars

Watchers

Forks