{"id":28003615,"url":"https://github.com/braheezy/zpix","last_synced_at":"2025-10-15T01:11:45.109Z","repository":{"id":260808452,"uuid":"882382878","full_name":"braheezy/zpix","owner":"braheezy","description":"Image decoding","archived":false,"fork":false,"pushed_at":"2025-05-08T16:30:01.000Z","size":5427,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-09T02:15:15.917Z","etag":null,"topics":["jpeg","png","zig"],"latest_commit_sha":null,"homepage":"","language":"Zig","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/braheezy.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}},"created_at":"2024-11-02T17:25:41.000Z","updated_at":"2025-05-08T16:30:04.000Z","dependencies_parsed_at":"2024-11-26T09:20:18.197Z","dependency_job_id":"114e11d2-fced-457b-94b8-ee35de367bb8","html_url":"https://github.com/braheezy/zpix","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"e61ce3e9ac3a71f5ba3a25d646410132075a28aa"},"previous_names":["braheezy/zjpeg","braheezy/zpix"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/braheezy/zpix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/braheezy%2Fzpix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/braheezy%2Fzpix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/braheezy%2Fzpix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/braheezy%2Fzpix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/braheezy","download_url":"https://codeload.github.com/braheezy/zpix/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/braheezy%2Fzpix/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264519717,"owners_count":23621857,"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":["jpeg","png","zig"],"created_at":"2025-05-09T02:15:14.636Z","updated_at":"2025-10-15T01:11:40.082Z","avatar_url":"https://github.com/braheezy.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zpix\n\nImage decoding library in pure Zig. It supports:\n\n**JPEG**\n\n- Baseline and Progressive formats\n- Gray, YCbCr, RGBA, and YCMK color formats.\n\n**PNG**\n\n- Gray 1, 2, 4, 8, and 16 bit\n- Gray + alpha 8 bit and 16 bit\n- Truecolor 8 bit and 16 bit\n- Truecolor + alpha, 8 bit and 16 bit\n- Paletted 1, 2, 4, and 8 bit\n- Interlaced\n\n**QOI**\n\n- Encoding and decoding Quite OK Image (QOI) file format.\n\nHere's proof! The Mac image viewer on the left, and a SDL image viewer in Zig using `zpix` to view a JPEG file:\n![demo](demo.png)\n\n## Usage\n\nAdd to project:\n\n    zig fetch --save git+https://github.com/braheezy/zpix\n\nIn your `build.zig`:\n\n    const zpix = b.dependency(\"zpix\", .{});\n    root_module.addImport(\"zjpeg\", zpix.module(\"jpeg\"));\n    root_module.addImport(\"png\", zpix.module(\"png\"));\n    // Or the whole module that has everything\n    exe.root_module.addImport(\"zpix\", zpix.module(\"zpix\"));\n\nIn your program, load an image file\n\n```zig\nconst jpeg = @import(\"jpeg\");\nconst png  = @import(\"png\");\nconst qoi  = @import(\"qoi\");\n// or const jpeg = @import(\"zpix\").jpeg;\n// or const png  = @import(\"zpix\").png;\n// or const qoi  = @import(\"zpix\").qoi;\n\nconst img = if (std.mem.eql(u8, file_ext, \".jpg\") or std.mem.eql(u8, file_ext, \".jpeg\"))\n    try jpeg.load(allocator, arg)\nelse if (std.mem.eql(u8, file_ext, \".png\")) png: {\n    const img = png.load(allocator, arg) catch {\n        std.process.exit(0);\n    };\n    break :png img;\n} else if (std.mem.eql(u8, file_ext, \".qoi\")) qoi: {\n    const img = qoi.load(allocator, arg) catch {\n        std.process.exit(0);\n    };\n    break :qoi img;\n} else return error.UnsupportedFileExtension;\n\ndefer {\n    img.free(allocator);\n}\n// Do something with pixels\n```\n\nSee [`example/zpixview.zig`](./example/zpixview.zig) for an example with SDL.\n\n## Development\n\nRun using `zig`:\n\n    zig build run -- \u003cinput image\u003e\n\nOr build and run:\n\n    zig build\n    ./zig-out/bin/zpixview \u003cinput image\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbraheezy%2Fzpix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbraheezy%2Fzpix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbraheezy%2Fzpix/lists"}