{"id":13736607,"url":"https://github.com/jiro4989/pnm","last_synced_at":"2025-10-10T16:23:55.854Z","repository":{"id":54691480,"uuid":"182173086","full_name":"jiro4989/pnm","owner":"jiro4989","description":"Library for PNM in pure Nim.","archived":false,"fork":false,"pushed_at":"2021-03-20T12:10:03.000Z","size":1189,"stargazers_count":5,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-10T16:23:53.538Z","etag":null,"topics":["image","lib","library","nim","pnm"],"latest_commit_sha":null,"homepage":"https://jiro4989.github.io/pnm/pnm.html","language":"Nim","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/jiro4989.png","metadata":{"files":{"readme":"README.adoc","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}},"created_at":"2019-04-19T00:01:51.000Z","updated_at":"2025-08-27T12:19:55.000Z","dependencies_parsed_at":"2022-08-14T00:10:31.159Z","dependency_job_id":null,"html_url":"https://github.com/jiro4989/pnm","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/jiro4989/pnm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiro4989%2Fpnm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiro4989%2Fpnm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiro4989%2Fpnm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiro4989%2Fpnm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jiro4989","download_url":"https://codeload.github.com/jiro4989/pnm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiro4989%2Fpnm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279004687,"owners_count":26083748,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["image","lib","library","nim","pnm"],"created_at":"2024-08-03T03:01:24.901Z","updated_at":"2025-10-10T16:23:55.825Z","avatar_url":"https://github.com/jiro4989.png","language":"Nim","funding_links":[],"categories":["Multimedia"],"sub_categories":["Images"],"readme":":toc: left\n:sectnums:\n\n= pnm\n\nhttps://en.wikipedia.org/wiki/Netpbm_format[PNM (Portable Anymap)] parser/generator library in pure Nim.\n\nimage:https://github.com/jiro4989/pnm/workflows/test/badge.svg[\"Build Status\", link=\"https://github.com/jiro4989/pnm/actions\"]\n\n== Development\n\nnim -v\n\n  Nim Compiler Version 0.19.4 [Linux: amd64]\n  Compiled at 2019-02-01\n  Copyright (c) 2006-2018 by Andreas Rumpf\n\n  git hash: b6d96cafc8bcad1f3d32f2910b25cd11a93f7751\n  active boot switches: -d:release\n\n\nnimble -v\n\n  nimble v0.9.0 compiled at 2018-10-27 18:10:03\n  git hash: couldn't determine git hash\n\n== Install\n\n[source,bash]\nnimble install pnm\n\n== Usage\n\n=== Reading PGM file\n\n[source,nim]\n----\nimport pnm\n\nblock:\n  # P2\n  let p = readPGMFile(\"tests/out/p2.pgm\")\n  echo p\n\nblock:\n  # P5\n  let p = readPGMFile(\"tests/out/p5.pgm\")\n  echo p\n----\n\n=== Writing PGM file\n\n[source,nim]\n----\nimport pnm\n\nlet col = 6\nlet row = 12\nlet data = @[\n  0'u8, 0, 0, 0, 0, 0,\n  0'u8, 0, 0, 0, 0, 0,\n  0'u8, 0, 0, 0, 0, 0,\n  0'u8, 0, 0, 0, 0, 0,\n  1, 1, 1, 1, 1, 1,\n  1, 1, 1, 1, 1, 1,\n  1, 1, 1, 1, 1, 1,\n  1, 1, 1, 1, 1, 1,\n  2, 2, 2, 2, 2, 2,\n  2, 2, 2, 2, 2, 2,\n  2, 2, 2, 2, 2, 2,\n  2, 2, 2, 2, 2, 2,\n]\n\nblock:\n  # P2\n  let p = newPGM(pgmFileDescriptorP2, col, row, data)\n  writePGMFile(\"tests/out/p2.pgm\", p)\n\nblock:\n  # P5\n  let p = newPGM(pgmFileDescriptorP5, col, row, data)\n  writePGMFile(\"tests/out/p5.pgm\", p)\n----\n\n=== Other examples\n\nSee `examples` directory.\nRun example code.\n\nGenerating PBM.\n\n[source,bash]\ncd write_pbm\nnim c -d:release main.nim\n./main\n\nimage:docs/pbm_example.png[\"PBM example\"]\n\nGenerating PGM.\n\n[source,bash]\ncd write_pgm\nnim c -d:release main.nim\n./main\n\nimage:docs/pgm_example.png[\"PGM example\"]\n\nGenerating PPM.\n\n[source,bash]\ncd write_ppm\nnim c -d:release main.nim\n./main\n\nimage:docs/ppm_example1.png[\"PPM example1\"]\nimage:docs/ppm_example2.png[\"PPM example2\"]\n\nControling generated PNM files.\n\n[source,bash]\ncd read_file\nnim c -d:release main.nim\n./main\n\nimage:docs/ppm_example1.convert.png[\"Converted PPM example1\"]\n\n== Warning\n\nAvailable color byte of PGM and PPM is 1 byte (0~255).\n\n== Document\n\n* https://jiro4989.github.io/pnm/pnm.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiro4989%2Fpnm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjiro4989%2Fpnm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiro4989%2Fpnm/lists"}