What does HackerNews think of sharp?

High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, AVIF and TIFF images. Uses the libvips library.

Language: JavaScript

#33 in JavaScript
#12 in Node.js
I've recently used this approach for generating Open Graph images for display when a link to the site is used on Twitter, WhatsApp, Facebook, etc [1]. I was pleasantly surprised at how quickly something could be implemented. The last time I'd done something similar was using Cairo and needing to write more of the scaling dynamics. I don't think I ever got it to adjust to dynamic content very well. This time I put together a prototype in Inkscape, converted it to a template and render it to PNG with Sharp [2].

[1]: https://hntrends.net/api/og?word=twitter [2]: https://github.com/lovell/sharp

It would be awesome if sharp (https://github.com/lovell/sharp) would implement this algorithm
Nice! I found Hugo about halfway through working on this and it seemed like a great solution as well. The jhead utility would save me a ton of time as I ended up cross referencing my negatives to find processing dates which is all in the metadata.

I ended up using sharp [1] since it was so easy to integrate into my workflow.

1. https://github.com/lovell/sharp

Are the two most recent images _actually_ the same, as in a per-pixel match, or are you going to get random noise from dithering etc? If they are literally the same, then this becomes a lot easier.

You could easily set up a simple node.js program that uses fs.watcher to watch for new files, and https://github.com/lovell/sharp to process the two most recent images and see if the pixels are identical. If you need to package this into a standalone executable, you could use https://www.npmjs.com/package/pkg. Then you could use the built-in SMTP sender (if it is not blocked on your network) or mailgun or something of that nature to send the email.

You can do the same thing in other languages, like ruby, python, etc as well.

If the two images files are literally identical as in the same jpeg with all the same bytes, you could do this with a bash script that compares the sha1 or md5 hash of the two files and then consult https://stackoverflow.com/questions/5155923/sending-a-mail-f... for how to send an email from a bash script.

Sharp for node.js has proven to be powerful, flexible and fast for my needs: https://github.com/lovell/sharp/
Setting up your own resizer using sharp[1] is pretty simple. Just make sure you install the module in a Lambda-compatible environment, so it can build its copy of libvips (native C library) correctly. I built and deployed my image thumbnailer on a CentOS VM.

[1]: https://github.com/lovell/sharp

I made this mainly because I wanted a service to use for my own projects - but the existing solutions were either prohibitively expensive or didn't have uptime guarantees.

The backend for the processing service is nodejs and sharp[1], processed images are cached on CloudFlare. The processing servers are a custom instance type in an autoscaling group on Google Cloud.

Any feedback is greatly appreciated!

[1] https://github.com/lovell/sharp

Firesize uses ImageMagick, which in my experience consumes more memory and is slower than libvips [1] for simple image resizing/optimization.

I built a simple image-resizing server with a query string API using libvips [2]. This is based on sharp [3], a good wrapper of libvips for Node.js.

[1] https://github.com/jcupitt/libvips

[2] https://github.com/nthtran/imgop

[3] https://github.com/lovell/sharp

Has anyone tried sharp for node? Looks quite promising.

https://github.com/lovell/sharp