{"id":18721071,"url":"https://github.com/aslushnikov/spritesheet-assembler","last_synced_at":"2025-04-12T14:30:20.980Z","repository":{"id":45925210,"uuid":"82462743","full_name":"aslushnikov/spritesheet-assembler","owner":"aslushnikov","description":"Tiny spritesheet assembler with support for SVG and PNG formats.","archived":false,"fork":false,"pushed_at":"2021-11-27T18:38:04.000Z","size":101,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T09:02:32.199Z","etag":null,"topics":["png","spritesheet","spritesheet-packer","spritesheet-packing-algorithm","svg"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aslushnikov.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":"2017-02-19T13:56:40.000Z","updated_at":"2020-11-05T11:32:30.000Z","dependencies_parsed_at":"2022-09-05T18:21:31.497Z","dependency_job_id":null,"html_url":"https://github.com/aslushnikov/spritesheet-assembler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aslushnikov%2Fspritesheet-assembler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aslushnikov%2Fspritesheet-assembler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aslushnikov%2Fspritesheet-assembler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aslushnikov%2Fspritesheet-assembler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aslushnikov","download_url":"https://codeload.github.com/aslushnikov/spritesheet-assembler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248580925,"owners_count":21128080,"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":["png","spritesheet","spritesheet-packer","spritesheet-packing-algorithm","svg"],"created_at":"2024-11-07T13:33:27.572Z","updated_at":"2025-04-12T14:30:20.952Z","avatar_url":"https://github.com/aslushnikov.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spritesheet Assembler [![Build Status](https://travis-ci.org/aslushnikov/spritesheet-assembler.svg?branch=master)](https://travis-ci.org/aslushnikov/spritesheet-assembler)\n- Support for SVG/PNG/JPG sprites\n- Generate CSS/JSON descriptors\n- Simple: tiny source, minimal dependencies. Please fork/contribute!\n\n## Install\nThis package relies on GraphicsMagick, so:\n- OS X: `brew install graphicsmagick`\n- Linux: `sudo apt-get install graphicsmagick`\n\nInstall:\n```bash\nnpm install -g spritesheet-assembler\n```\nAnd run:\n```bash\nspass -i icons/ -o images/spritesheet.png -d styles/icons.css\n```\n\n## Demos\n\n1. CSS SpriteSheet [demo](https://aslushnikov.github.io/spritesheet-assembler/demos/css-spritesheet/)\n2. Spritesheet packing algorithm [demo](https://aslushnikov.github.io/spritesheet-assembler/demos/algorithm/)\n3. Check out utility results in  [tests](https://github.com/aslushnikov/spritesheet-assembler/tree/master/tests)\n\n## Algorithm\n\n- [Demo](https://aslushnikov.github.io/spritesheet-assembler/demos/algorithm/)\n- [Source](https://github.com/aslushnikov/spritesheet-assembler/blob/master/lib/Packer.js#L35)\n\nSpritesheet packing algorithm is based on the one described in  [Jake's great article](http://codeincomplete.com/posts/bin-packing/). This implementation, however, doesn't use binary tree, maintaining instead a list of free spaces.\n\n## Code Overview\n\nThe code is split into three parts:\n- `lib/` - all the logic of bin-packing is here. Lib provides core abstractions of\n`Sprite` and `SpriteSheet`, as well as the bin-packing algorithm itself. This\nfolder **doesn't and shouldn't** depend on any core node modules.\n- `compositors/` - this folder contains *compositors*, which are responsible for building actual spritesheet out of sprites. Compositors are associated with export mime types, the relation is defined in `compositors/index.js`.\n- `descriptors/` - this folder contains spritesheet descriptor generators. Descriptor generators are associated with descriptor mime type, the relation is defined in `descriptors/index.js`.\n\n## Tests\n\nEach test runs spritesheet-assembler with given arguments and compares generated files with expected results.\n\nTo run all tests:\n```bash\nnpm test\n```\n\nTo run only tests with 'svg' in name:\n```bash\nnpm test -- svg\n```\n\nTo reset test results for all svg tests: (or generate results for a newly added test):\n```bash\nnpm test -- svg reset-results\n```\nTo add a test:\n\n1. create a new folder under `tests/` folder which starts with\ntwo-digit number, e.g. `tests/01-some-new-test/`.\n2. add `arguments.js` file which should define input arguments for the utility: [example](https://github.com/aslushnikov/spritesheet-assembler/blob/master/tests/01-svg-simple/arguments.js)\n\n## History\n\nThis started as a patch to Chrome DevTools project: https://codereview.chromium.org/2671413004/\n\n## License\nSee [LICENSE](https://github.com/aslushnikov/spritesheet-assembler/blob/master/LICENSE) here.\n\n## Contacts\n\nFeel free to drop me a line at [aslushnikov@gmail.com](mailto:aslushnikov.com) or via [twitter](https://twitter.com/aslushnikov)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faslushnikov%2Fspritesheet-assembler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faslushnikov%2Fspritesheet-assembler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faslushnikov%2Fspritesheet-assembler/lists"}