

If you checkout the image, you'll see it's around 1148 × 750 and 131KB in size. Let's grab a photo from Pexels who provide royalty-free images and then try it out: $ curl -sSL "" > whale.jpg The ImageMagick sample is deployed as shrink-image. Shrink-image will reduce any image to 50% of its size. Now let's deploy the shrink-image function: $ faas-cli deploy -f samples.yml -filter=shrink-image
#Brew install wget curl imagemagick mac#
On Mac you can type in brew install faas-cliĬheck it worked with faas-cli version Deploy the samplesĬlone the CLI from GitHub which contains several samples, including ImageMagick: $ git clone

If you're on Linux or Windows type in: $ curl -sL | sudo -E sh Once you've deployed OpenFaaS, we now need to install the FaaS CLI tool:

If you already have a cluster ready or Docker on your laptop then this takes less than 60 seconds to deploy. Pre-reqsįollow the guide for setting up OpenFaaS Docker Swarm or Kubernetes below. Build serverless functions using Docker containers and deploy onto Kubernetes and Docker Swarm. OpenFaaS is Serverless, but on your terms. In this blog post I want to give you a fresh take on ImageMagick and deploy it as a scaleable serverless function with OpenFaaS and Kubernetes, or Docker Swarm. There's not much you cannot do with it, but one of the most common use-cases I've seen is reducing image size to generate thumbnails. ImageMagick is an age-old tool (27 years old today!) for Linux which is used for image manipulation and generation.
