View on GitHub

node-jimp-watermark

Add watermark on images using NodeJS and Jimp

Github Build Codacy Badge Codebeat Badge CodeFactor Badge DeepScan grade Analytics

Node Jimp Watermark

Add watermark to images using NodeJS and Jimp

Visitor stats

GitHub stars GitHub forks GitHub watchers GitHub followers

Code stats

GitHub code size in bytes GitHub repo size GitHub language count GitHub top language GitHub last commit

Usage

  1. Clone this repository
  2. Copy .env.example to .env
  3. Set values to all environmental variables in the .env file:

     # Turns on/off console logging
     WATERMARK_DEBUG=true
    
     # Absolute path to the file which will be used as a watermark
     WATERMARK_IMAGE=/Users/user/projects/icon.png
    
     # Absolute path to the folder containing the images
     WATERMARK_IMAGES=/Users/user/projects/images
    
     # Spacing between the watermark and the image edges
     # in percentage (from 0 to 100)
     WATERMARK_SPACING=2
    
     # Opacity of the watermark when placed over the image
     WATERMARK_OPACITY=0.5
    
     # Ratio in percentage (from 0 to 100) relative to
     # the watermarked image which is used to resize
     # the watermark if the watermark is larger
     WATERMARK_RESIZE_RATIO=10
    
     # The position of the watermark.
     # Possible values are:
     # N (north),
     # NE (northeast),
     # E (east),
     # SE (southeast),
     # S (south),
     # SW (southwest),
     # W (west),
     # NW (northwest),
     # C (center)
     WATERMARK_POSITION=SE
    
     # A pipe split words which shouldn't be found in the images file names
     WATERMARK_IGNORE=logo|icon|banner|unsplash|placeholder
    
  4. Run yarn start
  5. Profit

LICENSE

MIT


Connect with me:


                     

Support and sponsor my work: