{"id":19417770,"url":"https://github.com/bradsec/gocamo","last_synced_at":"2026-02-18T16:01:41.668Z","repository":{"id":307261379,"uuid":"1028906432","full_name":"bradsec/gocamo","owner":"bradsec","description":"A Go program that generates military-styled digital camouflage patterns.","archived":false,"fork":false,"pushed_at":"2025-11-27T23:06:26.000Z","size":857,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-30T12:50:39.656Z","etag":null,"topics":["camogen","camouflage","camouflage-images"],"latest_commit_sha":null,"homepage":"","language":"Go","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/bradsec.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-30T08:32:16.000Z","updated_at":"2025-11-27T23:06:28.000Z","dependencies_parsed_at":"2025-07-30T10:40:55.696Z","dependency_job_id":"ce9821db-006d-4abf-85d8-b9f4afee4ff4","html_url":"https://github.com/bradsec/gocamo","commit_stats":null,"previous_names":["bradsec/gocamo"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bradsec/gocamo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradsec%2Fgocamo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradsec%2Fgocamo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradsec%2Fgocamo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradsec%2Fgocamo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bradsec","download_url":"https://codeload.github.com/bradsec/gocamo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradsec%2Fgocamo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29585441,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T13:56:48.962Z","status":"ssl_error","status_checked_at":"2026-02-18T13:54:34.145Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["camogen","camouflage","camouflage-images"],"created_at":"2024-11-10T13:11:20.314Z","updated_at":"2026-02-18T16:01:41.662Z","avatar_url":"https://github.com/bradsec.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GOCAMO\n\n## A digital camouflage pattern image generator written in Go\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/bradsec/gocamo)](https://goreportcard.com/report/github.com/bradsec/gocamo)\n\nGOCAMO is a Go program that generates military-styled digital camouflage patterns. The patterns can be generated using custom color palettes specified in a JSON file or via command-line arguments. Images are saved in PNG format in the specified `output` directory. The output filename shows the HEX colors used and the resolution of the image. Two or more colors can be used in pattern palettes for patterns pat1, pat2, pat3, pat4, pat5.\n\n## Features\n\n- Generate digital camouflage patterns with customizable colors, unique patterns, and any resolution\n- Configurable base pixel size for different pattern granularity\n- Output images include color codes in the filename for easy reference\n- Multi-core processing for improved performance when generating multiple patterns\n\n## Generation Speed\n\nGeneration speed depends on the number of images, resolution, and base pixel size. Higher resolution and smaller base pixel sizes require more processing time. The program uses Go's concurrency features to leverage multiple CPU cores when processing multiple color palettes from a JSON file, significantly improving performance on multi-core systems.\n\n## Optimized File Size\n\nThe program will produce optimized small PNG file sizes for high-resolution patterns (when generating without `-noise` or `-edge`):\n- 280kB for a 4K image (`-w 3840 -h 2160`)\n- 1.6MB for a 4K image with `-noise` added\n- 9.4MB for a 4K image with `-edge` details added\n- 10.5MB for a 4K image with `-noise` and `-edge` details added\n\n## Pattern Types (pat1, pat2, pat3, pat4, all, image)\n\n### pat1 (set using `-t pat1`, default if no type specified)\n\n```terminal\ngocamo -c \"#46482f,#6d6851,#9b967f,#1e2415\" -t pat1 -w 900 -h 900\n```\n\n![Sample Images](samples/gocamo_000_custom_46482f_6d6851_9b967f_1e2415_pat1_w900x900.png)\n\n### pat2 (set using `-t pat2`)\n\n```terminal\ngocamo -c \"#46482f,#6d6851,#9b967f,#1e2415\" -t pat2 -w 900 -h 900\n```\n\n![Sample Images](samples/gocamo_001_custom_46482f_6d6851_9b967f_1e2415_pat2_w900x900.png)\n\n### pat3 (set using `-t pat3`)\n\n```terminal\ngocamo -c \"#46482f,#6d6851,#9b967f,#1e2415\" -t pat3 -w 900 -h 900\n```\n\n![Sample Images](samples/gocamo_002_custom_46482f_6d6851_9b967f_1e2415_pat3_w900x900.png)\n\n### pat4 (set using `-t pat4`)\n\n```terminal\ngocamo -c \"#46482f,#6d6851,#9b967f,#1e2415\" -t pat4 -w 900 -h 900\n```\n\n![Sample Images](samples/gocamo_003_custom_46482f_6d6851_9b967f_1e2415_pat4_w900x900.png)\n\n### pat5 (set using `-t pat5`)\n\n```terminal\ngocamo -c \"#46482f,#6d6851,#9b967f,#1e2415\" -t pat5 -w 900 -h 900\n```\n\n![Sample Images](samples/gocamo_004_custom_46482f_6d6851_9b967f_1e2415_pat5_w900x900.png)\n\n### all (set using `-t all`)\nThe all option generates patterns using all five pattern types (pat1, pat2, pat3, pat4, pat5) for each color palette provided. This is useful when you want to see all pattern variations for comparison or when generating a complete set of patterns from the same color scheme.\n\n```terminal\ngocamo -c \"#46482f,#6d6851,#9b967f,#1e2415\" -t all -w 900 -h 900\n```\n\nWhen using `-t all`, the tool will generate 5 patterns for each color palette:\n- One pattern using pat1 algorithm\n- One pattern using pat2 algorithm  \n- One pattern using pat3 algorithm\n- One pattern using pat4 algorithm\n- One pattern using pat5 algorithm\n\n### image (set using `-t image`, uses images in the `input` directory as reference)\nThe ImageGenerator processes an input image to create a camouflage-like pattern based on the original image's colors and features. Loads the input image and resizes it to the target dimensions while maintaining aspect ratio. Applies max pooling to reduce the image size and enhance prominent features. Applies a Laplacian filter to enhance edges and details in the image. Uses k-means clustering to extract the main colors from the processed image. Maps each pixel in the processed image to the closest main color.\n\nReference (source) photo:\n\n![Sample Images](input/photo_jungle.jpg)\n\n```terminal\ngocamo -t image -w 900 -h 900\n```\n\nPattern result with default `-b 4 and k 4`:\n\n![Sample Images](samples/image.png)\n\n```terminal\ngocamo -t image -w 900 -h 900 -b 10\n```\n\nPattern result with `-b 10`:\n\n![Sample Images](samples/image_b10.png)\n\n\n```terminal\ngocamo -t image -w 900 -h 900 -k 16\n```\n\nPattern result with default `-b 4` and 16 colors `k 16`:\n\n![Sample Images](samples/imagek16.png)\n\n```terminal\ngocamo -t image -w 900 -h 900 -b 10 -k 16\n```\n\nPattern result with `-b 10` and 16 colors `k 16`:\n\n![Sample Images](samples/imageb10k16.png)\n\n\n\n\n## Installing\n\n### Option 1 Download the pre-built Binary files from [Releases](https://github.com/bradsec/gocamo/releases)\n\n### Option 2 Use Go to install the latest version\nIf you have Go installed (https://go.dev/doc/install) you can install the latest version of gocamo with this command:\n```terminal\ngo install github.com/bradsec/gocamo/cmd/gocamo@latest\n````\n\n### Option 3 Clone Repo and Build\n\n```terminal\ngit clone https://github.com/bradsec/gocamo.git\ncd gocamo\ngo build -o gocamo ./cmd/gocamo\n# Copy the gocamo binary/executable to a directory in your system PATH\n```\n\n## Examples commands\n\n1. Generate a single pattern with specified colors (defaults to pat1 pattern):\n   ```\n   # Three color pat1 pattern (default)\n   gocamo -c \"#ffffff,#012169,#e4002b\"\n\n   # Three color pat4 pattern\n   gocamo -c \"#ffffff,#012169,#e4002b\" -t pat4\n\n   # Three color pat3 pattern\n   gocamo -c \"#ffffff,#012169,#e4002b\" -t pat3\n\n   # Generate all 4 pattern types with same colors\n   gocamo -c \"#ffffff,#012169,#e4002b\" -t all\n   ```\n\n2. Process multiple color palettes from a JSON file:\n   ```\n   # All color schemes as pat4 patterns\n   gocamo -j colors.json -t pat4\n\n   # Process all color schemes in `colors.json` (defaults to pat1)\n   gocamo -j colors.json\n\n   # Generate all 5 pattern types for each color scheme in JSON file\n   gocamo -j colors.json -t all\n   ```\n\n3. Make pattern from images use `-t image`, this option looks in the image input directory default `input` and processes the images, identifying clusters of colors to produce patterns based on the images. Will batch process any images in the directory. Change input directory with `-i` flag. Use `-b` to increase block pixel size in output pattern.\n   ```\n   gocamo -t image -b 10\n   ```\n\n3. Set custom dimensions:\n   ```\n   gocamo -j colors.json -w 3840 -h 2160\n   ```\n\n4. Set base pixel size (increase of decease pixels in patterns):\n   ```\n   gocamo -c \"#ffffff,#012169,#e4002b\" -b 6\n   ```\n\n5. Specify output directory:\n   ```\n   gocamo -j colors.json -o output_folder\n   ```\n\n6. Use specific number of CPU cores:\n   ```\n   gocamo -j colors.json -cores 4\n   ```\n7. Add noise to image (larger file size)\n   ```\n   gocamo -c \"#ffffff,#012169,#e4002b\" -noise\n   ```\n8. Add edge details to image (larger file size)\n   ```\n   gocamo -c \"#ffffff,#012169,#e4002b\" -edge\n   ```\n9. Add noise and edge details (largest file size)\n   ```\n   gocamo -c \"#ffffff,#012169,#e4002b\" -noise -edge\n   ```\n\n## Paths\n\n- New patterns will save to output directory (default is output)\n\n## Command Line Usage\n\n```\nUsage of ./gocamo:\n  -b int\n    \tSet the base pixel size (will be adjusted if necessary) (default 4)\n  -c string\n    \tGenerate a single pattern using a comma-separated list of hex colors\n  -cores int\n    \tNumber of CPU cores to use (1-24 available) (default 24)\n  -edge\n    \tAdd edge details to the pattern\n  -h int\n    \tSet the image height (default 1500)\n  -i string\n    \tInput directory containing images for image-based camouflage (default \"input\")\n  -j string\n    \tProcess a JSON file containing a list of color palettes\n  -k int\n    \tNumber of main colors for image-based camouflage (default 4)\n  -noise\n    \tAdd noise to the pattern\n  -o string\n    \tThe output directory for generated images (default \"output\")\n  -r string\n    \tColor ratios: 'random' for random ratios, integers like '2,1,3' (cycles if fewer than colors) (default: equal)\n  -t string\n    \tSet the pattern type (pat1, pat2, pat3, pat4, pat5, all, or image) (default \"pat1\")\n  -w int\n    \tSet the image width (default 1500)\n```\n\n## JSON Input Format\n\nWhen using the `-j` flag to process multiple patterns, you need to provide a JSON file containing color palettes. An example `colors.json` file is included in the repository. The format is as follows:\n\n```json\n[\n  {\n    \"name\": \"woodland_sentinel\",\n    \"colors\": [\n      \"#5e8553\",\n      \"#5c4f42\",\n      \"#333330\",\n      \"#c1bc94\"\n    ]\n  },\n  {\n    \"name\": \"mountain_mist\",\n    \"colors\": [\n      \"#9bb0c1\",\n      \"#c4cecc\",\n      \"#62779d\",\n      \"#414458\"\n    ]\n  }\n]\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradsec%2Fgocamo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbradsec%2Fgocamo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradsec%2Fgocamo/lists"}