{"id":23527373,"url":"https://github.com/zprodev/9-slicer","last_synced_at":"2025-04-22T14:25:08.428Z","repository":{"id":48269785,"uuid":"144719644","full_name":"zprodev/9-slicer","owner":"zprodev","description":"Convert PNG to 9slice","archived":false,"fork":false,"pushed_at":"2021-08-03T20:35:32.000Z","size":663,"stargazers_count":7,"open_issues_count":13,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T16:02:07.659Z","etag":null,"topics":["esmodules","nine-patch","nineslice"],"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/zprodev.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-08-14T12:50:43.000Z","updated_at":"2025-03-04T08:53:46.000Z","dependencies_parsed_at":"2022-08-22T21:40:07.471Z","dependency_job_id":null,"html_url":"https://github.com/zprodev/9-slicer","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zprodev%2F9-slicer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zprodev%2F9-slicer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zprodev%2F9-slicer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zprodev%2F9-slicer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zprodev","download_url":"https://codeload.github.com/zprodev/9-slicer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250257108,"owners_count":21400652,"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":["esmodules","nine-patch","nineslice"],"created_at":"2024-12-25T20:14:08.306Z","updated_at":"2025-04-22T14:25:08.408Z","avatar_url":"https://github.com/zprodev.png","language":"TypeScript","readme":"# 9-slicer\n\n[![Build Status](https://travis-ci.org/zprodev/9-slicer.svg?branch=master)](https://travis-ci.org/zprodev/9-slicer)\n[![npm](https://img.shields.io/npm/v/9-slicer.svg)](https://www.npmjs.com/package/9-slicer)\n[![license](https://img.shields.io/github/license/zprodev/9-slicer.svg)](LICENSE)\n\nAutomatically judge the enlarged area and create 9 slice images\n\n## Examples\n\n### input\n\n![input.png](https://raw.githubusercontent.com/zprodev/9-slicer/master/docs/img/input.png)\n\n### output\n\nSliced PNG\n\n![output.png](https://raw.githubusercontent.com/zprodev/9-slicer/master/docs/img/output.png)\n\nParameters\n\n```\n{ width: 420,\n  height: 240,\n  left: 46,\n  right: 45,\n  top: 48,\n  bottom: 48 }\n```\n\n## Demo\n\n[9 SLICER](https://zprodev.github.io/9-slicer/demo/)\n\n## Distribution\n\n### npm\n\n```\nnpm i -D 9-slicer\n```\n\n### files\n\n[for CommonJS](https://github.com/zprodev/9-slicer/tree/master/dist/cjs)\n\n[for Browser](https://github.com/zprodev/9-slicer/tree/master/dist/browser)\n\n[for ESModules](https://github.com/zprodev/9-slicer/tree/master/dist/esm)\n\n## Usage\n\n### for CommonJS\n\n```\nconst { readFileSync, writeFileSync }  = require('fs');\nconst { slice } = require('9-slicer');\n\nconst input = readFileSync('input.png');\nconst output = slice(input);\n\n// Example of outputting only things that can be reduced by 30% or more\nif(30 \u003c= output.reduction){\n  writeFileSync('output.png', output.buffer);\n  writeFileSync('output.json', JSON.stringify(output.params));\n}\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzprodev%2F9-slicer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzprodev%2F9-slicer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzprodev%2F9-slicer/lists"}