Create your own image mosaics.
Download the latest release from the github releases page. Unzip and put the binary somewhere on your PATH.
λ gosaic index ~/tmp/cover_art
GOSAIC: 2016/12/14 17:53:14 Indexing 1744 images...
1744 / 1744 [===========================================================================================] 100.00% 1m39s
λ gosaic mosaic aspect ~/tmp/obi.jpg --width 3600 --height 3600 -n obi-aspect
GOSAIC: 2016/12/14 18:00:27 Building 900 cover partials...
900 / 900 [================================================================================================] 100.00% 0s
GOSAIC: 2016/12/14 18:00:30 Wrote cover image: /home/atongen/tmp/obi-aspect-cover.png
GOSAIC: 2016/12/14 18:00:31 Wrote macro image: /home/atongen/tmp/obi-aspect-macro.jpg
GOSAIC: 2016/12/14 18:00:31 Building 900 macro partials...
900 / 900 [===============================================================================================] 100.00% 27s
GOSAIC: 2016/12/14 18:00:58 Building 1744 index image partials...
1744 / 1744 [==============================================================================================] 100.00% 0s
GOSAIC: 2016/12/14 18:00:59 Building 1569600 partial image comparisons...
1569600 / 1569600 [===================================================================================] 100.00% 2h8m24s
GOSAIC: 2016/12/14 20:09:24 Building 900 mosaic partials...
900 / 900 [===============================================================================================] 100.00% 36s
GOSAIC: 2016/12/14 20:10:01 Drawing 900 mosaic partials...
900 / 900 [===============================================================================================] 100.00% 30s
GOSAIC: 2016/12/14 20:10:32 Wrote mosaic image: /home/atongen/tmp/obi-aspect-mosaic.jpg
λ bin/gosaic mosaic quad ~/tmp/obi.jpg --width 3600 --height 3600 -n obi-quad
GOSAIC: 2016/12/14 07:06:55 Wrote macro image: /home/atongen/tmp/obi-quad-macro.jpg
GOSAIC: 2016/12/14 07:06:55 Building macro quad with 700 splits, 2104 partials, min depth 3, max depth 9, min area 1794, max area 360000
2104 / 2104 [===========================================================================================================] 100.00% 4m34s
GOSAIC: 2016/12/14 07:11:31 Wrote cover image: /home/atongen/tmp/obi-quad-cover.png
GOSAIC: 2016/12/14 07:11:31 Building 1744 index image partials...
1744 / 1744 [===========================================================================================================] 100.00% 4m25s
GOSAIC: 2016/12/14 07:16:00 Building 3669376 partial image comparisons...
3669376 / 3669376 [=================================================================================================] 100.00% 10h38m33s
GOSAIC: 2016/12/14 17:54:33 Building 2104 mosaic partials...
2104 / 2104 [===========================================================================================================] 100.00% 1m40s
GOSAIC: 2016/12/14 17:56:13 Drawing 2104 mosaic partials...
2104 / 2104 [============================================================================================================] 100.00% 1m8s
GOSAIC: 2016/12/14 17:57:23 Wrote mosaic image: /home/atongen/tmp/obi-quad-mosaic.jpg
There are two steps to creating an image mosaic with gosaic. First, add images to an index. These are the small images that will make up the tiles in the mosaic. Second, build the mosaic from an image using the images added to the index.
Gosaic will populate a local sqlite3 database with metadata used to build the photo mosaic. It will not modify any images added to the index, and it will not modify the aspect ratio of any of the partial index images, or the large image rendered in the mosaic.
Three images will be produced: The cover image, which shows a grid where the partial index images will be placed against the large (macro) image. The macro image, which is the large image that the final mosiac is based on. It is cropped and resized to the exact size of the final mosaic image. This is sometimes useful for post-processing. And the final mosaic image. The final mosaic jpeg image is created at 300 dpi.
The best mosaics will be created from large indexes with a wide variety of high quality images. However, large indexes will increase the amount of time required to generate a mosaic. It's usually best to start small and do some experimentation and work your way up to a large mosaic. Gosaic does its best to calculate sane defaults for all values, so in most cases a basic command will result in a good mosaic.
Use the index sub-command to add images to an index. For example:
λ gosaic index path/to/image/directory
λ gosaic index path/to/file1.jpg path/to/file2.jpg
Or, if you have a file with a list of files and/or directories that you want to add to the index, you can do something like:
λ gosaic index < path/to/list.txt
If images in your index have been modified, re-indexing the same directory or files will calculate only the changes.
If images in your index have been removed from your hard drive, then run the index command with the --clean flag to verify the existing index,
and remove any images from the index that are no longer found.
index sub-command help:
λ gosaic index -h
Manage index images
Usage:
gosaic index [PATHS...] [flags]
Flags:
-c, --clean Clean the index
-l, --list List the index
-r, --rm Remove entries from the index
Global Flags:
--db string Path to project database (default "$HOME/.gosaic.sqlite3")
--workers int Number of workers to use (default 8)
mosaic aspect sub-command help:
λ gosaic mosaic aspect -h
Create an aspect mosaic from image at PATH
Usage:
gosaic mosaic aspect PATH [flags]
Flags:
-a, --aspect string Aspect of mosaic partials (CxR)
--cleanup Delete mosaic metadata after completion
--cover-out string File to write cover partial pattern image
-d, --destructive Delete mosaic metadata during creation
-f, --fill-type string Mosaic fill to use, either 'random' or 'best' (default "random")
--height int Pixel height of mosaic, 0 maintains aspect from width
--macro-out string File to write resized macro image
--max-repeats int Number of times an index image can be repeated, 0 is unlimited, -1 is the minimun number (default -1)
-n, --name string Name of mosaic
--out string File to write final mosaic image
-s, --size int Number of mosaic partials in smallest dimension, 0 auto-calculates
-t, --threashold float How similar aspect ratios must be (default -1)
-w, --width int Pixel width of mosaic, 0 maintains aspect from image height
Global Flags:
--db string Path to project database (default "$HOME/.gosaic.sqlite3")
--workers int Number of workers to use (default 8)
mosaic quad sub-command help:
λ gosaic mosaic quad -h
Create quad-tree mosaic from image at PATH
Usage:
gosaic mosaic quad PATH [flags]
Flags:
--cleanup Delete mosaic metadata after completion
--cover-out string File to write cover partial pattern image
-d, --destructive Delete mosaic metadata during creation
-f, --fill-type string Mosaic fill to use, either 'random' or 'best' (default "random")
--height int Pixel height of mosaic, 0 maintains aspect from width
--macro-out string File to write resized macro image
--max-area int The largest a partial can be (default -1)
--max-depth int Number of times a partial can be split into quads (default -1)
--max-repeats int Number of times an index image can be repeated, 0 is unlimited, -1 is the minimun number (default -1)
--min-area int The smallest a partial can get before it can't be split (default -1)
--min-depth int Minimum number of times all partials will be split into quads (default -1)
-n, --name string Name of mosaic
-o, --out string File to write final mosaic image
-s, --size int Number of times to split the partials into quads (default -1)
-t, --threashold float How similar aspect ratios must be (default -1)
-w, --width int Pixel width of mosaic, 0 maintains aspect from image height
Global Flags:
--db string Path to project database (default "$HOME/.gosaic.sqlite3")
--workers int Number of workers to use (default 8)
$ claude mcp add gosaic \
-- python -m otcore.mcp_server <graph>