This node script uses css-doodle and html-to-image to apply a randomly generated pattern to an image.
- Node >= 12.16.2
npm install
node generateImages.js <number_of_images_to_generate> <path_to_image>
node generateImages.js 5 ./examples/ghost.png
This script will generate an output
folder with the generated patterns
and the final
resulting images
input | pattern | final |
---|---|---|
If you want to add even more randomness to the generator, you can. Simply:
- Create your new function in ./app/generatorFunctions.js
- Make sure your function returns a string with a valid css-doodle syntax
- Export your function in the end of the file
- Import it in the main generateImages.js file like this:
const {lines, boxes, characters, radial, myNewFunction} = generatorFuncs
- Add it to the function randomization function
getDoodleContainer()
inside generateImages.js