Async Image Processing with Node js Worker Threads
Next, we define the convertToGrayscale() function to handle the processing task. Within this function, we chain the grayscale() method from the sharp module to our instance, transforming the image to grayscale. Finally, we save the processed image in the processed_images folder using the toFile() method. In this tutorial, you’ll learn how to optimise images with…