Node script to crop an image from a folder, rotate it thru a 90 degrees anticlockwise and save the resulting image to another folder, then repeat same for the second part of the image (in this case).
to install packages
Copy your source image to the files folder, edit width, height, left and top values appropriately, then run:
to crop your image, in files folder, to export folder.
Reference: https://sharp.pixelplumbing.com/api-resize#extract
Many thanks to Lovell