{"id":51332413,"url":"https://github.com/logue/pds2img","last_synced_at":"2026-07-02T00:02:16.265Z","repository":{"id":353240044,"uuid":"1217982609","full_name":"logue/pds2img","owner":"logue","description":"NASA Planetary Data System (PDS) to PNG/TIFF convertion library.","archived":false,"fork":false,"pushed_at":"2026-06-04T23:16:11.000Z","size":2609,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-05T01:08:56.685Z","etag":null,"topics":["nasa-astronomy-picture","nasa-data","pds"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/logue.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null},"funding":{"github":"logue","ko_fi":"logue","custom":["https://www.paypal.me/logue"]}},"created_at":"2026-04-22T12:18:17.000Z","updated_at":"2026-06-04T23:16:16.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/logue/pds2img","commit_stats":null,"previous_names":["logue/pds2img"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/logue/pds2img","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logue%2Fpds2img","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logue%2Fpds2img/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logue%2Fpds2img/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logue%2Fpds2img/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/logue","download_url":"https://codeload.github.com/logue/pds2img/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logue%2Fpds2img/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35027341,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-01T02:00:05.325Z","response_time":130,"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":["nasa-astronomy-picture","nasa-data","pds"],"created_at":"2026-07-02T00:02:15.135Z","updated_at":"2026-07-02T00:02:16.260Z","avatar_url":"https://github.com/logue.png","language":"TypeScript","funding_links":["https://github.com/sponsors/logue","https://ko-fi.com/logue","https://www.paypal.me/logue"],"categories":[],"sub_categories":[],"readme":"# 🛰️PDS2img\n\n[![jsdelivr CDN](https://data.jsdelivr.com/v1/package/npm/pds2img/badge)](https://www.jsdelivr.com/package/npm/pds2img)\n[![NPM Downloads](https://img.shields.io/npm/dm/pds2img.svg?style=flat)](https://www.npmjs.com/package/pds2img)\n[![Open in unpkg](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/pds2img/file/README.md)\n[![npm version](https://img.shields.io/npm/v/pds2img.svg)](https://www.npmjs.com/package/pds2img)\n[![Open in Gitpod](https://shields.io/badge/Open%20in-Gitpod-green?logo=Gitpod)](https://gitpod.io/#https://github.com/logue/pds2img)\n[![Twitter Follow](https://img.shields.io/twitter/follow/logue256?style=plastic)](https://twitter.com/logue256)\n\n\u003cfigure style=\"margin: 0 auto; text-align: center\"\u003e\n\n![C3592903_RAW](C3592903_RAW.png)\n\n\u003c/figure\u003e\n\n[NASA Planetary Data System (PDS)](https://pds.nasa.gov/) to PNG/TIFF conversion library.\n\n## Usage\n\nPDS3 (Voyager, Galileo, Cassini, etc.)\n\n```ts\nimport { loadPDS3ImageByUrl, toPNG, toTIFF } from 'pds2image';\n\nconst imgUrl = '/data/C3593229_RAW.IMG';\n\n// Load and parse PDS3 product\nconst image = await loadPDS3ImageByUrl(imgUrl);\n\n// Convert to PNG / TIFF ArrayBuffer\nconst pngBuffer = toPNG(image);\nconst tiffBuffer = toTIFF(image);\n```\n\nPDS4 (Modern spacecraft image)\n\n```ts\nimport { loadPDS4ImageByUrl, toPNG, toTIFF } from 'pds2image';\n\nconst xmlUrl =\n  '/data/FLG_1739_0821318674_675RAS_N0830000FHAZ00505_0A01I4J01.xml';\nconst imgUrl =\n  '/data/FLG_1739_0821318674_675RAS_N0830000FHAZ00505_0A01I4J01.IMG';\n\n// Load and parse PDS4 product\nconst image = await loadPDS4ImageByUrl(xmlUrl, imgUrl);\n\n// Convert to PNG / TIFF ArrayBuffer\nconst pngBuffer = toPNG(image);\nconst tiffBuffer = toTIFF(image);\n```\n\nPDS4 (File System Access API)\n\n```ts\nimport { loadPDSImageArrayBufferFromDirectory } from 'pds2image';\n\n// Browser only: user picks a directory that contains .xml + referenced .IMG\nconst directoryHandle = await window.showDirectoryPicker();\nconst float32Buffer =\n  await loadPDSImageArrayBufferFromDirectory(directoryHandle);\n\nconsole.log(float32Buffer.byteLength);\n```\n\nSave PNG / TIFF in browser\n\n```ts\nfunction saveArrayBuffer(\n  buffer: ArrayBuffer,\n  mimeType: string,\n  filename: string,\n): void {\n  const blob = new Blob([buffer], { type: mimeType });\n  const url = URL.createObjectURL(blob);\n\n  const anchor = document.createElement('a');\n  anchor.href = url;\n  anchor.download = filename;\n  anchor.click();\n\n  URL.revokeObjectURL(url);\n}\n\n// Example usage with previous PDS4 sample variables\nsaveArrayBuffer(pngBuffer, 'image/png', 'pds4-output.png');\nsaveArrayBuffer(tiffBuffer, 'image/tiff', 'pds4-output.tiff');\n```\n\nSave PNG / TIFF with user-selected location (File System Access API)\n\n```ts\nasync function saveArrayBufferWithPicker(\n  buffer: ArrayBuffer,\n  mimeType: string,\n  suggestedName: string,\n): Promise\u003cvoid\u003e {\n  // Fallback for browsers that do not support File System Access API\n  if (!('showSaveFilePicker' in window)) {\n    const blob = new Blob([buffer], { type: mimeType });\n    const url = URL.createObjectURL(blob);\n\n    const anchor = document.createElement('a');\n    anchor.href = url;\n    anchor.download = suggestedName;\n    anchor.click();\n\n    URL.revokeObjectURL(url);\n    return;\n  }\n\n  const handle = await window.showSaveFilePicker({\n    suggestedName,\n    types: [\n      {\n        description: mimeType,\n        accept: {\n          [mimeType]: [suggestedName.endsWith('.tiff') ? '.tiff' : '.png'],\n        },\n      },\n    ],\n  });\n\n  const writable = await handle.createWritable();\n  await writable.write(buffer);\n  await writable.close();\n}\n\n// Example usage with previous PDS4 sample variables\nawait saveArrayBufferWithPicker(pngBuffer, 'image/png', 'pds4-output.png');\nawait saveArrayBufferWithPicker(tiffBuffer, 'image/tiff', 'pds4-output.tiff');\n```\n\nCLI\n\n```bash\n# Build library first (CLI reads from dist/)\npnpm run build\n\n# PDS3 example (creates C3592903_RAW.png)\nbin/pds2img -i C3592903_RAW -type png\n\n# Explicit input path and output path\nbin/pds2img -i ./tests/data/C3592903_RAW -type tiff -o ./tests/data/out.tiff\n\n# Directory mode: convert all supported datasets in a directory\nbin/pds2img -d ./tests/data -type png\n\n# Directory mode with explicit output directory\nbin/pds2img -d ./tests/data -type tiff -o ./tests/out\n```\n\nNotes:\n\n- `-i` accepts a base path (`C3592903_RAW`), `.IMG` path, or `.xml` path.\n- `-d` converts all datasets in a directory: PDS3 (`.IMG + .LBL`) and PDS4 (`.xml`).\n- Detection order for base path input is PDS3 (`.IMG + .LBL`) then PDS4 (`.xml`).\n- In directory mode, `-o` is treated as an output directory.\n- On Windows PowerShell, run `./bin/pds2img.cmd ...`.\n\n## Setup\n\nInstall the dependencies:\n\n```bash\npnpm install\n```\n\n## Get started\n\nBuild the app for production:\n\n```bash\npnpm run build\n```\n\n## License\n\n©2026 by Logue.\nLicensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogue%2Fpds2img","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flogue%2Fpds2img","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogue%2Fpds2img/lists"}