Simple script that can be used in resizing and adding watermark to batch jpg and png files.
Ensure you have Node.js installed on your machine. You can download it from nodejs.org.
Install the dependencies:
npm install
Update the input_settings.json
file to configure the watermark text, opacity, compression quality, and maximum image width:
{
"watermark_text": "AYLSWORTH",
"watermark_opacity": 0.3,
"compression_quality": 50,
"max_image_width": 1200,
"filename_prefix": "aylsworth"
}
- watermark_text: The text to be used as the watermark on the images.
- watermark_opacity: The opacity of the watermark text, ranging from 0 (completely transparent) to 1 (completely opaque).
- compression_quality: The quality of the image compression, ranging from 0 (lowest quality, highest compression) to 100 (highest quality, lowest compression).
- max_image_width: The maximum width of the resized images in pixels. Images wider than this value will be resized to this width while maintaining the aspect ratio.
- filename_prefix: (Optional) if needed to save the files to indexed file name e.g.
aylsworth_1.png
Created with the use of Github Copilot