{"id":23444072,"url":"https://github.com/sevagh/quadtree-compression","last_synced_at":"2025-04-09T22:45:45.951Z","repository":{"id":82225543,"uuid":"168644228","full_name":"sevagh/quadtree-compression","owner":"sevagh","description":"lossy image compression with quadtrees and protobuf","archived":false,"fork":false,"pushed_at":"2023-08-06T03:58:21.000Z","size":368,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T01:01:52.801Z","etag":null,"topics":["2d","gif-animation","image-compression","image-processing","quadtree","tree-structure"],"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/sevagh.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}},"created_at":"2019-02-01T04:53:18.000Z","updated_at":"2024-08-26T15:39:43.000Z","dependencies_parsed_at":"2024-06-21T18:54:11.493Z","dependency_job_id":"5d83212a-39ae-40a8-9ead-5cbdbba273c1","html_url":"https://github.com/sevagh/quadtree-compression","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sevagh%2Fquadtree-compression","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sevagh%2Fquadtree-compression/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sevagh%2Fquadtree-compression/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sevagh%2Fquadtree-compression/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sevagh","download_url":"https://codeload.github.com/sevagh/quadtree-compression/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248125569,"owners_count":21051765,"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":["2d","gif-animation","image-compression","image-processing","quadtree","tree-structure"],"created_at":"2024-12-23T18:26:22.225Z","updated_at":"2025-04-09T22:45:45.931Z","avatar_url":"https://github.com/sevagh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# quadtree-compression\n\nCreate cool GIFs and lossily compress images with quadtrees:\n![jungle-gif](./samples/jungle.gif)\n\n### Gif creation\n\nThe above GIF was generated with the following command:\n\n```\n$ ./quadtree-compression gif \\\n        -delayMS 50 -maxQuality 12 -ladder \\\n        ./samples/jungle.png \\\n        ./samples/jungle.gif\n```\n\nFirst, a point quadtree is built from the image containing colors per quadrant, and the average color of its 4 children (NE, NW, SE, SW), and their 4 children, etc.\n\nBy generating an image at level `n`, the quadtree is only descended to depth `n`.\n\nFinally, images at levels `[1-quality]` are collated in a GIF to produce the demo; the `-ladder` flag then appends the reverse order to \"ladder\" back down in quality to create a loop.\n\nThis produces the effect of the image \"sharpening\" as the color of each quadrant is replaced with the finer granularity of its descendants.\n\n### File compression/decompression\n\nAs a toy, there are two subcommands, `compress` and `decompress`. To compress an image and create a `.quadtree` file, the quadtree from the image is serialized to an array of uint32s, and then stored with protobuf:\n\n```\n$ ./quadtree-compression compress \\\n                    ./samples/jungle.png \\\n                    ./jungle.quadtree\n$\n$ du -h samples/jungle.png\n11M     samples/jungle.png\n$\n$ du -h ./jungle.quadtree\n6.8M    ./jungle.quadtree\n```\n\n`-quality` can be chosen, which, as described in the gif section, cuts the quadtree off at `depth=quality`. Low qualities create dramatically smaller quadtree files (e.g. 30K for quality=5, where the full quality is 6.8M).\n\nQuality = 5:\n\n![jungle-lowqual](./samples/jungle_lowqual.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsevagh%2Fquadtree-compression","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsevagh%2Fquadtree-compression","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsevagh%2Fquadtree-compression/lists"}