Tint An Image With The Node Sharp Module
Install sharp with:
Code
npm i sharp
Then do something like:
Code
const sharp =
const inputPath = 'source.jpg'
const color = '#372831'
const outputPath = 'output.jpg'
await ..
}
Here's the one that I use to make random color show art for my podcast. It checks to make sure the file doesn't exist before making one with a random color. That way I can delete any I don't like and rerun the process to make new ones without messing with the existing ones I do like.
Code
#!/usr/bin/env node
const sharp =
const fs =
const outputPath =
show === 'a'
? `output/ThePodOfAlan--S1-Ea--MainShow--ShowArt.jpg`
: `output/ThePodOfAlan--S1-Eb--AfterShow--ShowArt.jpg`
}