{"id":17610026,"url":"https://github.com/darnfish/escpos-image-processor","last_synced_at":"2025-04-30T15:17:28.247Z","repository":{"id":44099905,"uuid":"154687864","full_name":"darnfish/escpos-image-processor","owner":"darnfish","description":"Image processing for escpos-compatable printers","archived":false,"fork":false,"pushed_at":"2023-01-03T23:02:34.000Z","size":10017,"stargazers_count":8,"open_issues_count":20,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-25T08:45:02.653Z","etag":null,"topics":["canny-edge-detection","escpos","escpos-image","escpos-printable-image"],"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/darnfish.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}},"created_at":"2018-10-25T14:43:59.000Z","updated_at":"2023-01-31T17:06:24.000Z","dependencies_parsed_at":"2023-02-01T12:30:32.849Z","dependency_job_id":null,"html_url":"https://github.com/darnfish/escpos-image-processor","commit_stats":null,"previous_names":["printurmessages/escpos-image-processor"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darnfish%2Fescpos-image-processor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darnfish%2Fescpos-image-processor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darnfish%2Fescpos-image-processor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darnfish%2Fescpos-image-processor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darnfish","download_url":"https://codeload.github.com/darnfish/escpos-image-processor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242661651,"owners_count":20165329,"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":["canny-edge-detection","escpos","escpos-image","escpos-printable-image"],"created_at":"2024-10-22T17:43:03.541Z","updated_at":"2025-03-09T08:30:51.083Z","avatar_url":"https://github.com/darnfish.png","language":"TypeScript","readme":"# @printurmessages/escpos-image-processor\nA library that converts an image into an escpos-printable image\n\n## Installation\nThis library is available on the [NPM registry](https://www.npmjs.com/package/@printurmessages/escpos-image-processor). To install, run\n\n```\nnpm install @printurmessages/escpos-image-processor --save\n```\nIf you're using [Yarn](https://yarnpkg.com), run\n```\nyarn add @printurmessages/escpos-image-processor\n```\n\n## Usage\n\n```javascript\n// Import the package\nimport ESCPOSImageProcessor from '@printurmessages/escpos-image-processor'\n\n// Create an instance of the class\nconst processor = new ESCPOSImageProcessor({\n    width: 185, /* optional, defaults to 185 (default 40mm printer roll width in px) */\n    quality: 'best' /* optional, defaults to 'best' (slowest). another option is 'good', which is faster but produces worse results */\n})\n\n// Put the path to your image in the first parameter ('.in.png') and put the location where the image should be saved in the second parameter ('./processed.png').\nprocessor.convert('./in.png', './processed.png').then(path =\u003e {\n    // The callback will return the path if all went well, if there was an error it will return 'false'.\n    if(path)\n        console.log(`Processed image saved to ${path}`)\n    else\n        console.log('An Error Occurred')\n}).catch(error =\u003e console.error(error))\n```\n## Usage with `escpos`\nIf you wish to use `escpos-image-processor` with the `escpos` module, look at the example below:\n\n```javascript\nimport escpos from 'escpos'\nimport ESCPOSImageProcessor from '@printurmessages/escpos-image-processor'\n\nconst device  = new escpos.USB()\nconst printer = new escpos.Printer(device)\n\nconst processor = new ESCPOSImageProcessor({\n    width: 185,\n    quality: 'best'\n})\n\nprocessor.convert('./in.png', './processed.png').then(path =\u003e {\n    if(path) {\n        console.log(`Processed image saved to ${path}, printing...`)\n\n        processor.print(device, printer)\n    } else\n        console.log('An Error Occurred')\n}).catch(error =\u003e console.error(error))\n```\n\n## License\n`escpos-image-processor` is licensed under the MIT License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarnfish%2Fescpos-image-processor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarnfish%2Fescpos-image-processor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarnfish%2Fescpos-image-processor/lists"}