8 ms·
Um. This would not seem to be relevant only if you didn't bother reading the article in the submission. Once you do, you'll notice the following example there:
by yogthos 4y ago
Um.
This would not seem to be relevant only if you didn't bother reading the article in the submission. Once you do, you'll notice the following example there:
After some searching I found manicmaniac/sips-js-api which is the only place online I could see that documented how to use the sips --js option. Here's their example - save this in smile.js:
const canvas = new Canvas(150, 150)
canvas.beginPath()
canvas.arc(75, 75, 50, 0, Math.PI * 2, true)
canvas.moveTo(110, 75)
canvas.arc(75, 75, 35, 0, Math.PI, false)
canvas.moveTo(65, 65)
canvas.arc(60, 65, 5, 0, Math.PI * 2, true)
canvas.moveTo(95, 65)
canvas.arc(90, 65, 5, 0, Math.PI * 2, true)
canvas.stroke()
const output = new Output(canvas, sips.outputPath)
output.addToQueue()
Then run:
sips -j smile.js -o smile.png
This produces an alpha-transparent PNG of a smiling face.
The obvious advantage of using node over sips is that it works on every platform. You'll also have to elaborate on what this additional effort you speak of is. If you have node installed, as practically everyone does nowadays, then the presumed effort is in having to run npm install?
Also, you obviously don't have to use Clojure, I chose it because that's the language I already use and like. You could just make a regular Js file as well.
Hope that helped clarify things for you.