An experiment with image processing using sharpjs, resemblejs and fast-csv

By Hanut Singh Gusain on 04/06/2022

/images/uploads/nodejs/cli-and-image-processing/header.jpg

I have been taking time off from regularly talking / writing about the technologies I love of late due to a rather painful series of tooth extractions. Now that I have finally got my head back in the game, I decided to do something interesting and hacked together a mini project that consists of a several powerful tools for any Node.js developer.

What I was trying to do

I heard about an interesting problem from one of my friends recently and I felt it would make for a very short and sweet exercise to keep the blood in my fingers flowing.

I fired up vscode and began to pen down my readme with an overview of the project -

The application essentially consists of three parts -

  1. A CLI parser that is responsible for reading in the name of the input csv file as an absolute path
  2. A CSV parser/writer (Fast CSV in our case) that lets us easily read csv files and write them out as well. This is used to read a list of image pairs from the input file.
  3. Image processor / scanner that can standardize input images to a single format and then match them for visual similarity, responding with a score that identifies if the images match or are very different.

Talk is cheap, show me the code !

The repository for the project contains instructions on how to use it as well -

hanut/image-compare