{"id":3125,"url":"https://github.com/jondot/blade","last_synced_at":"2025-04-04T22:08:53.717Z","repository":{"id":36072157,"uuid":"40371667","full_name":"jondot/blade","owner":"jondot","description":"Better asset workflow for iOS developers. Generate Xcode image catalogs for iOS / OSX app icons, universal images, and more.","archived":false,"fork":false,"pushed_at":"2017-12-08T09:06:29.000Z","size":4278,"stargazers_count":815,"open_issues_count":9,"forks_count":36,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-03-28T21:09:06.004Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jondot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-07T17:09:18.000Z","updated_at":"2025-01-22T13:56:50.000Z","dependencies_parsed_at":"2022-08-31T22:26:12.460Z","dependency_job_id":null,"html_url":"https://github.com/jondot/blade","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jondot%2Fblade","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jondot%2Fblade/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jondot%2Fblade/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jondot%2Fblade/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jondot","download_url":"https://codeload.github.com/jondot/blade/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247256115,"owners_count":20909240,"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":[],"created_at":"2024-01-05T20:16:32.094Z","updated_at":"2025-04-04T22:08:53.698Z","avatar_url":"https://github.com/jondot.png","language":"Go","funding_links":[],"categories":["Tools","Go","WebSocket"],"sub_categories":["Web View","Other free courses"],"readme":"\u003ch1 align=\"center\"\u003e\n  Blade\n  \u003cimg src=\"https://travis-ci.org/jondot/blade.svg?branch=master\" alt=\"Build Status\" /\u003e\n  \u003cbr/\u003e\n  \u003cimg src=\"docs/blade-s.png\" alt=\"Blade\" /\u003e\n\u003c/h1\u003e\n\nAutomatically build and rebuild Xcode image catalogs for app icons, universal images, and more.\n\n\n\n\n* Use in existing projects to generate image catalogs with no extra work. Blade will automagically refresh your image catalogs based on given master images.\n* Use templates of image catalogs to generate new catalogs (see [templates](templates/)).\n\nSee [blade-sample](https://github.com/jondot/blade-sample) for a preconfigured project.\n\n\n## Why?\n\nBecause most of the time your image catalogs are the same image, resized to various sizes.\n\nHere is how people solve this usually:\n\n* Have the designer slice the images manually / automatically using a [PSD template](http://appicontemplate.com/)\n* Use some sort of [online image slicing service](http://makeappicon.com/) which emails you a zip of the various sizes\n\nThe problem with these solutions is:\n\n* Some times the various slices are not up to date with Xcode (new devices, new sizes)\n* It Almost always require extra work from you (placing each image manually in the catalog, fixing mismatches etc.)\n* You can't control the quality of the resize\n* You can't integrate the tooling into your build workflow or CI\n\nBlade is an open source tool which will replace the PSD template and/or online services for you, and has a goal to satisfy the above requirements in the best way possible.\n\n\n## Quick start\n\nYou have 2 ways to install:\n\n#### Homebrew\n\nUsing Homebrew:\n\n```\n $ brew tap jondot/tap\n $ brew install blade\n```\n\n#### Release\n\nDownload one of the binaries in [releases](https://github.com/jondot/blade/releases), and put in your `PATH` or just include in each Xcode project's root.\n\n\n\nThis should be a typical run of blade:\n\n\n\n#### Use a Bladefile\n\nHere's how a project setup with a Bladefile feels like (more in the [Blade Sample](https://github.com/jondot/blade-sample) repo): \n\n![](docs/blade-walkthrough.gif)\n\n\nThe best way to use Blade, is to set up a local `Bladefile` for your entire project. Within it, specify all of your resources. Blade will pick it up automatically.\n\n_See [blade-sample](https://github.com/jondot/blade-sample) for a preconfigured project._\n\n```\n$ blade --init\nWrote Bladefile.\n```\nHere is how your `Bladefile` would look like:\n\n```yaml\nblades:\n  - source: iTunesArtwork@2x.png\n    mount: foobar/Assets.xcassets/AppIcon.appiconset\n  - source: Spaceship_1024.png\n    mount: foobar/Assets.xcassets/Spaceship.imageset\n```\n\nIt was made for this project structure:\n\n```\nfoobar\n├── Bladefile\n├── images\n│   ├── iTunesArtwork@2x.png\n│   └── Spaceship_1024.png\n├── foobar\n│   ├── AppDelegate.swift\n│   ├── Assets.xcassets\n│   │   ├── AppIcon.appiconset\n│   │   │   └── Contents.json\n│   │   └── Spaceship.imageset\n│   │       ├── Contents.json\n```\n\nThen use Blade (use --verbose if you want logs) within the same folder where your `Bladefile` lives:\n\n```\n$ blade --verbose\nINFO[0000] Found a local Bladefile.\nINFO[0000] Bladefile contains 2 blade defs.\n...\n```\n\nAnd it will generate all of the images needed within each image catalog.\n\nTo make this happen before each build see [how to run a script while building a product](https://developer.apple.com/library/ios/recipes/xcode_help-project_editor/Articles/AddingaRunScriptBuildPhase.html)\n\n\n\n\n#### Use directly\n\n\n![](docs/blade.gif)\n\n\n```\n$ blade --source=iTunesArtwork@2x.png --template=templates/watch.json --out=out/watch --catalog\n```\n\nHere's what we did:\n\n* Use a source image (`--source`)\n* Make a brand new image catalog (`--catalog`), from a template (`templates/watch.json`)\n* Put everything in `out/watch`\n\n\n```\n$ blade -s iTunesArtwork@2x.png -t existing.imageset -o existing.imageset\n```\n\nHere's what we did:\n\n* Use a source image (`-s`)\n* Point to an existing image catalog (`-t`)\n* Output to that same existing image catalog (`-o`)\n* In other words, Blade will refresh the images in this catalog\n\n\n\n## How does it work?\n\n\nBlade parses __the same Xcode image catalog__ configuration file as its own configuration source - no new concept introduced. This allows it to be future-proof with Xcode updates for new image sizes and catalog types.\n\n\nSupported workflows:\n\n* __Prototyping__ ad-hoc, while prototyping projects\n* __Development__ build with Build Steps, transforming all of your source image assets to image catalogs\n* __CI__ in your CI servers, either on OSX or Linux (though Linux can't compile code in this case, you can still use it to do image processing)\n\n\nSupported resize algorithms (`-i` or `--interpolation` flag):\n\n* `l3`: [Lanczos3](https://en.wikipedia.org/wiki/Lanczos_resampling) - _Default_\n* `l2`: [Lanczos2](https://en.wikipedia.org/wiki/Lanczos_resampling)\n* `n`:  [Nearest Neighbor](https://en.wikipedia.org/wiki/Nearest-neighbor_interpolation)\n* `bc`: [Bicubic](https://en.wikipedia.org/wiki/Bicubic_interpolation)\n* `bl`: [Bilinear](https://en.wikipedia.org/wiki/Bilinear_interpolation)\n* `mn`: [Mitchell-Netravali](https://de.wikipedia.org/wiki/Mitchell-Netravali-Filter)\n\nSee [here](https://github.com/nfnt/resize) for live samples.\n\n\n\n\n## Hacking on Blade\n\nPull requests are happily accepted.\n\nHere's what you should know if you want to improve Blade:\n\n* Your workflow starting point is the `Makefile`. There you should see how to setup the development tooling, run builds, tests and coverage.\n* The architecture splits out the runner from the converter, so that we could swap to other, faster, converters (vips) if needed.\n* The other concerns are the `Contents.json` ([contents.go](contents.go)) parsing and dimension ([dimensions.go](dimensions.go)) computation logic.\n* Finally, you're left with the Bladefile ([bladefile.go](bladefile.go)) and CLI ([main.go](main.go)) logic to handle.\n\nAlso, check out [fixtures](fixtures) for quick image catalog configuration to work with.\n\nHere is a typical flow:\n\n1. Clone project\n2. Branch off for your changes\n3. Edit code\n4. Test your changes, submit PR\n5. (release) `make bump`\n6. (release) `make release`\n7. (release) use hub to upload release binaries\n8. (release) `make brew_sha ver=\u003ccurrent version\u003e`\n8. (release) update jondot/homebrew-tap version and sha to point to new binary\n\n(* 'release' flows are done by core committers)\n\n\n\n# Contributing\n\nFork, implement, add tests, pull request, get my everlasting thanks and a respectable place here :).\n\n\n# Copyright\n\nCopyright (c) 2015 [Dotan Nahum](http://gplus.to/dotan) [@jondot](http://twitter.com/jondot). See MIT-LICENSE for further details.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjondot%2Fblade","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjondot%2Fblade","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjondot%2Fblade/lists"}