Hacker News new | ask | show | jobs
by aikah 4056 days ago
Would be more useful on the server. I don't know how it is impplemented, I guess it uses canvas, fortunately there a few serverside canvas implementations available.
1 comments

Uses canvas as per the documentation:

"Converts all resources into an Image object by applying the function draw. The draw function receives all resources as canvases..."

I went down the same thought process as you.. Would be useful on the server, coupled with node-canvas.

Wonder whether it would be faster / more scalable than calling out to ImageMagick to add gradients or text to an Image..

I think this library could defer altering the window object until it is certain it is in a browser context. The original design goal was for a browser, but the issue has already come up on leveraging node-canvas to make it useful on the server as well:

https://github.com/brianium/watermarkjs/issues/11