Skip to content

IkeAlmighty/flyer-creator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ–ΌοΈ Image Text Overlay Processor

This Node.js script processes every image in the ./images folder by:

  • Cropping it to a centered 800x600 region
  • Darkening the image
  • Overlaying multiple lines of white text centered on the image
  • Saving the processed result as a .png file in the ./processed directory

πŸ“¦ Dependencies

Make sure you have Node.js installed, then install the required packages:

npm install sharp @napi-rs/canvas

πŸ“ Folder Structure

your-project/
β”œβ”€β”€ images/        # Place your source images here (jpg, jpeg, png)
β”œβ”€β”€ processed/     # Processed images will be output here
β”œβ”€β”€ script.js      # The main script file

πŸš€ Usage

Run the script with one or more lines of text as arguments:

node script.js "First Line" "Second Line" "Third Line"

Example:

node script.js "Scones!" "Freshly Baked" "All Summer"

This will overlay:

Scones!
Freshly Baked
All Summer

…centered vertically and horizontally on each image.

πŸ“ Notes

  • Only .jpg, .jpeg, and .png files in the ./images folder are processed.

  • All output images are saved as .png, regardless of original format.

  • Fonts are hardcoded to Courier New for the first line and Georgia for subsequent lines (you can customize this in the script).

✨ Customization

You can modify the following values in the script to adjust image size or text style:

const cropWidth = 800;
const cropHeight = 600;
ctx.font = "bold 55px Courier New"; // Main font
ctx.font = "25px Georgia"; // Subsequent lines

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published