{"id":48946735,"url":"https://github.com/punctuations/avid","last_synced_at":"2026-04-17T17:06:54.297Z","repository":{"id":350346375,"uuid":"1205610002","full_name":"punctuations/avid","owner":"punctuations","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-10T00:00:46.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-10T01:12:59.800Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Gleam","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/punctuations.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-09T05:50:12.000Z","updated_at":"2026-04-10T00:00:50.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/punctuations/avid","commit_stats":null,"previous_names":["punctuations/avid"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/punctuations/avid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/punctuations%2Favid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/punctuations%2Favid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/punctuations%2Favid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/punctuations%2Favid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/punctuations","download_url":"https://codeload.github.com/punctuations/avid/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/punctuations%2Favid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31937751,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T12:37:54.787Z","status":"ssl_error","status_checked_at":"2026-04-17T12:37:25.095Z","response_time":62,"last_error":"SSL_read: 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":[],"created_at":"2026-04-17T17:06:52.160Z","updated_at":"2026-04-17T17:06:54.288Z","avatar_url":"https://github.com/punctuations.png","language":"Gleam","funding_links":[],"categories":[],"sub_categories":[],"readme":"# avid\n\nA deterministic avatar generator written in Gleam. Convert any name string into\na unique, symmetric, colorful avatar.\n\n## How it works\n\n```\nName string\n    │\n    V\nFNV-1a 32-bit hash          (fast, good distribution, pure bitwise ops)\n    │\n    ├─\u003e Hue from bits [7..0]  -\u003e foreground + background color via HSL -\u003e RGB\n    │\n    └─\u003e Bits [0..14]          -\u003e 5x5 mirrored boolean grid\n            │\n            └─\u003e Rendered to SVG / BMP / PNG\n```\n\nThe 5x5 grid is mirrored left \u003c-\u003e right, giving it symmetry. Color is derived\nfrom a hue extracted from the hash and converted through integer-only HSL -\u003e RGB\nmath.\n\n## Usage\n\n```gleam\nimport avid\n\npub fn main() {\n  let av = avid.from_name(\"John Doe\")\n\n  // SVG - pass pixel size for width/height attributes\n  let svg: String = avid.to_svg(av, 200)\n\n  // BMP - pass cell_size (pixels per grid cell); 40 -\u003e 200x200\n  let bmp: BitArray = avid.to_bmp(av, 40)\n\n  // PNG - same cell_size convention\n  let png: BitArray = avid.to_png(av, 40)\n}\n```\n\n## Running\n\n```sh\ngleam test    # run all tests\ngleam build   # compile\n```\n\n## Implementation notes\n\n### BMP format\n\nThe simplest possible image format. Header is 54 bytes (14-byte file header +\n40-byte DIB header), followed by raw BGR pixel triplets. Rows are padded to\nmultiples of 4 bytes. Negative height value in the header means rows are stored\ntop-down.\n\n### PNG format\n\nA valid PNG with:\n\n- `IHDR`: 8-bit RGB truecolor, no interlacing\n- `IDAT`: zlib-wrapped (CMF=0x78, FLG=0x01), stored deflate blocks (BTYPE=00),\n  Adler-32 checksum - no actual compression but fully spec-compliant\n- `IEND`: end marker\n- CRC-32 on each chunk computed with the IEEE 802.3 reflected polynomial\n\n### Hash function\n\nFNV-1a 32-bit. XOR-then-multiply per byte, masked to 32 bits. Offset basis:\n2166136261, prime: 16777619.\n\n### Color\n\nHSL -\u003e RGB using integer arithmetic only (scaled to x10 range). Hue is extracted\nfrom bits [7..0] of the hash and scaled to 0–359. Saturation is fixed at 65% for\nforeground (vivid) and 30% for background (muted). Lightness variants come from\nbits [9..8].\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpunctuations%2Favid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpunctuations%2Favid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpunctuations%2Favid/lists"}