I am working on some project where I need to have a lot of image files (preferably in jpg) format of predefined sizes (Not the height and width but file size in Kb/Mb).
So I might need to generate a random image of 100 KB in size and another random image of 2 MB in size.
How should I go about this using NodeJS?
I found this Random Image Generator code to generate a random image but it does not allow me to specify the file size.
All suggestions and wild guesses are welcome.