imagecolorizer

1.0.0 • Public • Published

imagecolorizer

A module for colorizing grayscale images using color palettes generated with the newcolorgen module.

Installation

You can install imagecolorizer via npm:

npm install imagecolorizer

Usage

const colorizeImage = require('imagecolorizer');

// Example usage
const inputImagePath = 'grayscale_image.jpg';
const outputImagePath = 'colorized_image.jpg';
const baseColor = '#3498db'; // Base color in hex format
const numColors = 5; // Number of colors in the palette

colorizeImage(inputImagePath, outputImagePath, baseColor, numColors)
    .then(() => console.log('Image colorization completed.'))
    .catch(err => console.error('Error:', err));

Make sure to replace 'grayscale_image.jpg' with the path to your grayscale image. This module reads the grayscale image, generates a color palette using newcolorgen, and then colorizes the grayscale image based on the palette. Finally, it saves the colorized image to the specified output path.

License

This module is open source and available under the MIT License.

Package Sidebar

Install

npm i imagecolorizer

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

3 kB

Total Files

3

Last publish

Collaborators

  • renderlynx