Skip to content

candyland-app/candyland-dependency

Repository files navigation


Candyland Dependency

📷 Image watermarking dependency for the Candyland web app




Heroku Deployed Build Status Dependency Status XO code style

Related

Contents

Description

Building the image watermarking dependency for the Candyland webapp.

You can view a live app demo here.

CLI

$ node cli.js --help

  📷 Image watermarking dependency for the Candyland web app

  Usage
    $ node cli.js [<options> ...]

  Options
    --help, -h        Display help message
    --input, -i       Input file path
    --output, -o      Output file path
    --text, -t        Watermark text
    --color, -c       Watermark RGB color value
    --version, -v     Display installed version

  Examples
    $ node cli.js --help
    $ node cli.js -i dogo.png -t 'Super Dogo!'
    $ node cli.js -i dogo.png -o super-dogo.png -t 'Super Dogo!'
    $ node cli.js -i dogo.png -t 'Super Dogo!' -c 'rgba(0, 255, 0)'

Usage

const watermak = require('./index');

const inputImage = 'dogo.png';  // Input image path
const color = 'rgb(255, 0, 0)'; // Watermark text color
const text = 'Super Awesome Dogo!'; // Watermark text
const outputImage = 'dogoWatermarked.png';  // Output image path

watermark.addWatermark(inputImage, outputImage, text, color);

API

addWatermak(input, output, text, color)

Example: addWatermak.('Hello.png', 'world.png', 'Hello World', 'rgb(0, 255, 0)');

input

  • Type: String

  • Optional: False

  • Default Value: None

Path of input png, jpg, gif image file.

output

  • Type: String

  • Optional: True

  • Default Value: ~/candyland-watermark.png

Path of output png, jpg, gif image file.
If not provided the output file will be saved at the home directory under the name ~/candyland-watermark.png.

text

  • Type: String

  • Optional: True

  • Default Value: 'Candyland Watermark'

Text to be user as watermark on input image file.
If not provided the default text value will be used.

color

  • Type: String

  • Optional: True

  • Default Value: rgb(255, 0, 0)

Color to be used for the watermark text.
Any rgb color value is valid to be used.
If not provided the default color red rgb(255, 0, 0) will be used.

Development

The only external app dependency is imagemagick.

You can get it straight from your system's official software repositories or by manually downloading the binaries from the official imagemagick homepage.

  • Clone this repository to your local machine
  • Navigate to your clone cd candyland-dependency
  • Install the dependencies npm install
  • Build the development server npm start
  • Run the API npm run dist
  • Run the CLI interface npm run cli
  • Cleanup assets & compiled files npm run clean

Team

License

MIT © Candyland team