{"id":16099273,"url":"https://github.com/kagof/pixel-perfect-svg","last_synced_at":"2025-03-17T17:31:21.653Z","repository":{"id":57325024,"uuid":"412778931","full_name":"kagof/pixel-perfect-svg","owner":"kagof","description":"NodeJS CLI to convert pixel art to an SVG","archived":false,"fork":false,"pushed_at":"2021-10-07T19:42:14.000Z","size":2446,"stargazers_count":56,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T13:22:49.135Z","etag":null,"topics":["cli","nodejs","npm","pixel-art","svg","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/pixel-perfect-svg","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/kagof.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-02T11:39:32.000Z","updated_at":"2025-03-04T23:03:41.000Z","dependencies_parsed_at":"2022-09-18T03:32:33.337Z","dependency_job_id":null,"html_url":"https://github.com/kagof/pixel-perfect-svg","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kagof%2Fpixel-perfect-svg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kagof%2Fpixel-perfect-svg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kagof%2Fpixel-perfect-svg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kagof%2Fpixel-perfect-svg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kagof","download_url":"https://codeload.github.com/kagof/pixel-perfect-svg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244078015,"owners_count":20394397,"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":["cli","nodejs","npm","pixel-art","svg","typescript"],"created_at":"2024-10-09T18:26:38.164Z","updated_at":"2025-03-17T17:31:20.486Z","avatar_url":"https://github.com/kagof.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pixel-perfect-svg\n\n[![main branch tests](https://github.com/kagof/pixel-perfect-svg/actions/workflows/test.yml/badge.svg)](https://gist.github.com/kagof/51cfc9d8c5122fb3581c383ac3ba5a54)[![npm version](https://img.shields.io/npm/v/pixel-perfect-svg)](https://www.npmjs.com/package/pixel-perfect-svg)\n\nThis is a CLI written in Typescript as a yak shave for [IntelliJ Pokémon Progress Bar](https://github.com/kagof/intellij-pokemon-progress). It converts images (PNG, GIF, or JPEG) into an SVG with pixel perfect precision.\n\nThe original intended use case for this was creating easily scalable versions of pixel art images.\n\n![Demo](./eg/demo.gif)\n\n## Example\n\n### Command\n\n```bash\ncurl \\\n  https://upload.wikimedia.org/wikipedia/commons/9/93/I_C_Watermellon.png \\\n  --output - \\\n| psvg -p -o eg/example.svg\n```\n\n### Result\n\n[\u003cimg alt=\"Result\" src=\"./eg/example.svg\" width=\"100\" height=\"100\" /\u003e](./eg/example.svg)\n\n## Features\n\n* handles PNG, GIF, and JPEG images\n* handles alpha channel transparency, including partial\n* can handle animated inputs by specifying a frame to look at (default is the first frame)\n* can trim the output SVG\n* input can be a filename or stdin, output can be a filename or stdout\n* file size is somewhat optimized, can be further reduced by ensuring `--pretty` is off and turning `--no-metadata` on\n* enhanced logging available with `--verbose`\n\n## Installing the CLI\n\nThe CLI can be installed from NPM:\n\n```bash\nnpm install -g pixel-perfect-svg\n```\n\n## Using the CLI\n\n```bash\npsvg --help # to print usage guide\n\npsvg [ -i \u003cinput\u003e | -o \u003coutput\u003e | -F \u003cframe\u003e | -qVpmT | -l \u003camount\u003e | -r\n\u003camount\u003e | -t  \u003camount\u003e | -b  \u003camount\u003e | -w  \u003camount\u003e | -h  \u003camount\u003e]\n\nOptions:\n      --help             Show help                                     [boolean]\n  -v, --version          Show version number                           [boolean]\n  -i, --input            input PNG, JPEG, or GIF file                   [string]\n  -o, --output           output SVG file                                [string]\n  -F, --frame            frame of the input image to use   [number] [default: 0]\n  -q, --quiet            turn off logging             [boolean] [default: false]\n  -V, --verbose          turn on verbose logging      [boolean] [default: false]\n  -p, --pretty           nicely format the output SVG [boolean] [default: false]\n  -m, --no-metadata      do not add metadata tag      [boolean] [default: false]\n  -T, --trim             trim blank space on output   [boolean] [default: false]\n  -l, --max-left-trim    maximum amount to trim on the left             [number]\n  -r, --max-right-trim   maximum amount to trim on the right            [number]\n  -t, --max-top-trim     maximum amount to trim on the top              [number]\n  -b, --max-bottom-trim  maximum amount to trim on the bottom           [number]\n  -w, --min-width        minimum width of the image after trimming      [number]\n  -h, --min-height       minimum width of the image after trimming      [number]\n\nExamples:\n  psvg -i in.png -o out.svg  input from arg, output to file\n  psvg -o out.svg            input from stdin, output to file\n  psvg -i in.png -q          input from arg, output to stdout (-q/--quiet\n                             recommended)\n  psvg -q                    input from stdin, output to stdout (-q/--quiet\n                             recommended)\n\ntakes a PNG, GIF, or JPEG file and outputs a pixel perfect SVG\npixel-perfect-svg from https://github.com/kagof/pixel-perfect-svg\n```\n\n```bash\npsvg -i input.png -o output.svg\n```\n\n```bash\ncat input.png | psvg -q \u003e output.svg\n```\n\n## Testing\n\nThis package uses `jest` for its tests. They can be run with\n\n```bash\nnpm test\n```\n\nThis will also run `ESLint`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkagof%2Fpixel-perfect-svg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkagof%2Fpixel-perfect-svg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkagof%2Fpixel-perfect-svg/lists"}