https://github.com/bor0/mosgen
Mosaic generator
https://github.com/bor0/mosgen
image-generator mosaic racket scheme
Last synced: 3 months ago
JSON representation
Mosaic generator
- Host: GitHub
- URL: https://github.com/bor0/mosgen
- Owner: bor0
- Created: 2016-08-10T17:00:34.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-08-17T17:52:08.000Z (over 8 years ago)
- Last Synced: 2024-12-26T17:45:35.891Z (4 months ago)
- Topics: image-generator, mosaic, racket, scheme
- Language: Racket
- Size: 50.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Mosaic generator
----------------
Hello. I wrote this mainly as an exercise to train my Scheme skills. Obviously you need to have DrRacket installed on your machine and have `racket` existing somewhere in the bin folders.The way it works is in a couple of steps. So let's get started with it:
1. We need to set up our gallery folder. Let's call it X. This folder X will contain images that we would like to use in the destination image. Note that the utility will search for png files.
2. We need to calc the average RGB values of all the files in X, and store this data. We can do that by issuing the following command:
`racket avg-rgb.rkt X > avg-rgb-vals.txt`
3. We need to figure out what our image input will be. Let's call its location Y.
4. Let N be the size of the crop we will be doing to the source image (NxN). Generate the output by issuing the following command:
`racket build-mosaic.rkt Y N avg-rgb-vals.txt > mosaic.html`The above process will output an HTML file `mosaic.html` that contains references to all of the specified images in step 1 that match the best Euclidean distance.
Here is an example of a generated mosaic using a library of 100 random images:

Boro Sitnikovski
August 2016