{"id":16978601,"url":"https://github.com/willdady/emosaic","last_synced_at":"2025-06-15T09:08:00.947Z","repository":{"id":147045659,"uuid":"200451891","full_name":"willdady/emosaic","owner":"willdady","description":"Mosaic image generator written in Rust!","archived":false,"fork":false,"pushed_at":"2022-09-17T07:25:44.000Z","size":713,"stargazers_count":103,"open_issues_count":0,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-02T05:46:17.260Z","etag":null,"topics":["command-line-tool","generative-art","image-processing","rust","rust-lang"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/willdady.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-08-04T05:02:29.000Z","updated_at":"2025-01-11T22:06:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"11ee1902-a4c1-4a56-99e7-a7b9daefd41f","html_url":"https://github.com/willdady/emosaic","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/willdady/emosaic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willdady%2Femosaic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willdady%2Femosaic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willdady%2Femosaic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willdady%2Femosaic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willdady","download_url":"https://codeload.github.com/willdady/emosaic/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willdady%2Femosaic/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259949682,"owners_count":22936411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line-tool","generative-art","image-processing","rust","rust-lang"],"created_at":"2024-10-14T01:43:48.058Z","updated_at":"2025-06-15T09:08:00.915Z","avatar_url":"https://github.com/willdady.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# emosaic\n\nMosaic generator written in [Rust!](https://www.rust-lang.org/)\n\n![](example/warhol.png?raw=true)\n\n## Building\n\nTo build [make sure you have rust installed](https://www.rust-lang.org/tools/install).\n\n```\ncargo build --release\n```\n\nOnce compiled, the binary can be found at `target/release/emosaic` in the repository root.\n\n## Usage\n\nThe command expects a path to a directory containing square 'tile' images and a source image.\n\n```\nemosaic /path/to/tile/images/ source.png\n```\n\n### Modes\n\nThe strategy used to generate the mosaic is controlled by the `-m, --mode` option.\n\n#### 1to1 (Default)\n\nFor each pixel in the source image a tile with the nearest matching average color will be emitted.\n\nAssuming a source image with dimensions 100x100 and default tile size of 16 the output image will be 1600x1600.\n\n#### 4to1\n\nFor every 2x2 pixels one tile will be emitted. Tiles are divided into 2x2 segments and the average colour of each segment is stored. The tile with the nearest average color in _each_ segment to the target pixels will be chosen. This mode may provide smoother transitions between tile images and works best if you have a large tile set.\n\nAssuming a source image with dimensions 100x100 and default tile size of 16 the output image will be 800x800.\n\n#### random\n\nThe source image is not analysed and tiles are simply randomized in the output. This mode is best combined with the `-t, --tint-opacity` option to overlay the source image on top of the output. If your source image only contains a few colors (like a logo) this is the mode you want.\n\nAssuming a source image with dimensions 100x100 and default tile size of 16 the output image will be 1600x1600.\n\n### Output path\n\nBy default the resulting image will be output to the current directory as `output.png`. You can specify the output file with the `-o, --output` option e.g.\n\n```\nemosaic -o /foo/bar/myimage.png /path/to/tile/images/ source.png\n```\n\nOutput format is _always_ PNG.\n\n### Controlling tile size\n\nEach 'tile' in the output image will be 16x16 by default. Provide a custom size with the `-s, --tile-size` option. Note the size of your source image and tile size dictate the final size of your output image. For example, if your source image is 100x200 and you specify a tile size of 32 with the default mode _1to1_ the output image will be 3200x6400! So be careful!\n\n```\nemosaic -s 32 /path/to/tile/images/ source.png\n```\n\n### Tinting\n\nUse the tinting option, `-t, --tint-opacity`, to control the transparency of the source image overlayed on top of the the output mosaic. This can be useful to push the overall color of each tile closer to the color(s) it was sampled from in the source image. Value must be between 0 and 1. Default is 0.\n\n```\nemosaic -t 0.5 /path/to/tile/images/ source.png\n```\n\n### Force\n\nWhen invoking emosaic for a given directory the images will be analysed with the results written to a cache file in the directory as `.emosiac_*`. For example, invoking emosaic with `-m 4to1` will output a file named `.emosaic_4to1` in your tiles directory. Emosaic always looks for an existing cache file in the tiles directory before analysing tiles. This offers a significant speed-up when creating multiple images from the same source tiles.\n\nIf you add, remove or change images in your tiles directory you must delete the `.emosaic_*` file(s) so that your tiles are reanalysed and a new cache file is created. You can either delete the file(s) manually or simply invoke emosaic with `-f` to force reanalysis and update the cache file.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilldady%2Femosaic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilldady%2Femosaic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilldady%2Femosaic/lists"}