The function of uploading images to generate thumbnails has been implemented using gm. You can refer to this library, but your server must be pre-installed with GraphicsMagick or ImageMagick. http://aheckmann.github.io/gm/
I have had related needs when using NW.js as a client before. I have found some implementations and experienced them myself. Let me give you recommendations for the two situations.
If it is pure Node.js, I recommend a domestic images library https://github.com/zhangyuanw... It imitates JQ syntax, Chinese documentation, and does not rely on other image processing libraries.
If you are using NW.js or Electron, which can use canvas, I recommend using canvas directly to implement it. You can take screenshots, pick colors, get the pixel values of all pixels, etc., and it is easy to transplant
The function of uploading images to generate thumbnails has been implemented using gm. You can refer to this library, but your server must be pre-installed with GraphicsMagick or ImageMagick.
http://aheckmann.github.io/gm/
I have had related needs when using NW.js as a client before. I have found some implementations and experienced them myself. Let me give you recommendations for the two situations.
If it is pure Node.js, I recommend a domestic images library https://github.com/zhangyuanw... It imitates JQ syntax, Chinese documentation, and does not rely on other image processing libraries.
If you are using NW.js or Electron, which can use canvas, I recommend using canvas directly to implement it. You can take screenshots, pick colors, get the pixel values of all pixels, etc., and it is easy to transplant