{"id":18658856,"url":"https://github.com/durobot/export_ppm","last_synced_at":"2025-11-06T00:30:25.638Z","repository":{"id":212312779,"uuid":"731174431","full_name":"Durobot/export_ppm","owner":"Durobot","description":"A couple of functions to export data as a PPM/PGM image file from your Zig code","archived":false,"fork":false,"pushed_at":"2024-03-06T11:17:53.000Z","size":19,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-15T06:53:57.023Z","etag":null,"topics":["pgm","pgm-format","pgm-image","pgm-writer","ppm","ppm-format","ppm-image","zig","zig-package","ziglang"],"latest_commit_sha":null,"homepage":"","language":"Zig","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/Durobot.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":"2023-12-13T14:11:24.000Z","updated_at":"2025-01-07T23:48:10.000Z","dependencies_parsed_at":"2024-03-06T12:42:37.031Z","dependency_job_id":null,"html_url":"https://github.com/Durobot/export_ppm","commit_stats":null,"previous_names":["durobot/export_ppm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Durobot%2Fexport_ppm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Durobot%2Fexport_ppm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Durobot%2Fexport_ppm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Durobot%2Fexport_ppm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Durobot","download_url":"https://codeload.github.com/Durobot/export_ppm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239475962,"owners_count":19645041,"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":["pgm","pgm-format","pgm-image","pgm-writer","ppm","ppm-format","ppm-image","zig","zig-package","ziglang"],"created_at":"2024-11-07T07:34:40.250Z","updated_at":"2025-11-06T00:30:25.575Z","avatar_url":"https://github.com/Durobot.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# export_ppm\n\nJust a couple of functions in Zig that export image data, RGB/RGBA/grayscale/grayscale+alpha (but alpha channel is ignored), 8 or 16 bits per channel, as PPM/PGM files. Not enough code to be called a library.\n\nPPM and PGM are very simple graphic file formats, but they are widespread enough for popular editors, like [Gimp](https://www.gimp.org/), [Krita](https://krita.org) or [Adobe Photoshop](https://www.adobe.com/creativecloud/file-types/image/raster/ppm-file.html) to be able to open them. Meaning you can quickly dump whatever you want from your Zig programs as a PPM/PGM file and open it in an editor.\n\nSee https://en.wikipedia.org/wiki/Netpbm?useskin=vector, https://netpbm.sourceforge.net/doc/ppm.html.\n\nCheck out the tests in  `export_ppm.zig` for examples of use.\n\n**test_data_src** folder contains PNG images I used as test data, ignore them or use them however you want. I release them in public domain.\n\n**export_ppm.zig** is licensed under [the MIT License](https://en.wikipedia.org/w/index.php?title=MIT_License\u0026useskin=vector).\n\nJust drop `export_ppm.zig` into your project and add `const eppm = @import(\"export_ppm.zig\");`, or use the Zig package manager:\n\n1. In your project's `build.zig.zon`, in `.dependencies`, add\n\n   ```zig\n   .export_ppm =\n   .{\n       .url = \"https://github.com/Durobot/export_ppm/archive/\u003cGIT COMMIT HASH, 40 HEX DIGITS\u003e.tar.gz\",\n       .hash = \"\u003cZIG PACKAGE HASH, 68 HEX DIGITS\u003e\" // Use arbitrary hash, get correct hash from the error \n   }\n   ```\n\n2. In your project's `build.zig`, in `pub fn build`, before `b.installArtifact(exe);`, add\n\n   ```zig\n   const eppm = b.dependency(\"export_ppm\",\n   .{\n       .target = target,\n       .optimize = optimize,\n   });\n   exe.root_module.addImport(\"export_ppm\", eppm.module(\"export_ppm\"));\n   ```\n\n3. Add `const eppm = @import(\"export_ppm\");`in your source file(s).\n\n4. Build your project with `zig build`, as you normally do.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdurobot%2Fexport_ppm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdurobot%2Fexport_ppm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdurobot%2Fexport_ppm/lists"}