{"id":13632816,"url":"https://github.com/holman/spaceman-diff","last_synced_at":"2025-10-24T13:28:57.021Z","repository":{"id":17122468,"uuid":"19888641","full_name":"holman/spaceman-diff","owner":"holman","description":"diff images from the command line","archived":false,"fork":false,"pushed_at":"2019-01-17T17:48:39.000Z","size":103,"stargazers_count":470,"open_issues_count":2,"forks_count":12,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-10-04T11:14:37.488Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://zachholman.com/posts/command-line-image-diffs/","language":"Shell","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/holman.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":"2014-05-17T14:36:38.000Z","updated_at":"2025-09-25T03:14:27.000Z","dependencies_parsed_at":"2022-08-24T10:40:43.804Z","dependency_job_id":null,"html_url":"https://github.com/holman/spaceman-diff","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/holman/spaceman-diff","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holman%2Fspaceman-diff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holman%2Fspaceman-diff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holman%2Fspaceman-diff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holman%2Fspaceman-diff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/holman","download_url":"https://codeload.github.com/holman/spaceman-diff/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holman%2Fspaceman-diff/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280805413,"owners_count":26394431,"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","status":"online","status_checked_at":"2025-10-24T02:00:06.418Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-08-01T22:03:17.171Z","updated_at":"2025-10-24T13:28:56.981Z","avatar_url":"https://github.com/holman.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# spaceman-diff\n\ndiff images from the command line\n\n![](https://cloud.githubusercontent.com/assets/2723/3005174/e28c2e00-ddd1-11e3-9dd8-c2c150e0ac86.jpg)\n\n## what's inside™\n\nImportant business programmers don't have time to switch away from their terminal to view the diff of an image they're about to commit. The three seconds it takes to open an external diff visualization program could drive your sales team to drink and make inappropriate remarks to your new employees. Increase your productivity bottom line today, with `spaceman-diff`!\n\n`spaceman-diff` is a quick drop in to `git-diff`. The idea is that you can just `git diff` like normal and, if you've changed an image file, `spaceman-diff` will render your images in a colorful ASCII approximation in your shell along with helpful data like file size changes.\n\nHere's a quick example of what you might see:\n\n![spaceman screenshot](https://user-images.githubusercontent.com/5113/51319639-e9e6ab80-1a5d-11e9-9cfe-ec0ea731ccde.png)\n\nThe goal is that `spaceman-diff` gives you a quick way of verifying that yes, the image you're committing is the image you want to commit, and yes, the image you're committing isn't accidentally 20 terabytes in size or something foolish like that.\n\nNote: right now, spaceman-diff requires a *change* in the image; you won't see a diff rendered if you're simply adding or removing a file to your repo. `git diff` apparently doesn't pass things through to spaceman-diff at all in this case. There's probably a way to handle this, so pull requests accepted.\n\n## dependencies\n\nThere are two dependencies that you need before you can fiddle with pixels and characters and junk: [jp2a][jp2a] and [ImageMagick][imagemagick]. `jp2a` handles conversion of a JPEG to ASCII, and ImageMagick can do everything from image conversion to probably running a nuclear reactor.\n\n### os x\n\nIf you're using [Homebrew][brew], blindly run this:\n\n    brew install jp2a imagemagick\n\n### linux\n\nIf you're using `apt`, you should be able to install your dependencies in a similar manner:\n\n    sudo apt-get install jp2a imagemagick\n\n## install\n\nOnce you have your dependencies installed, drop [`spaceman-diff`][binary] onto your system or your dotfiles directory or whatever kooky stuff you're using. If you're using [Homebrew](http://brew.sh), you can instead install `spaceman-diff` with `brew install spaceman-diff`. After that, you need to configure Git to use `spaceman-diff` for all your image diffs.\n\nIf you don't have one already, create a file at `~/.config/git/attributes` and add this to it:\n\n```txt\n*.png  diff=spaceman-diff\n*.jpg  diff=spaceman-diff\n*.jpeg diff=spaceman-diff\n*.gif  diff=spaceman-diff\n```\n\nThis basically tells Git to use the `spaceman-diff` strategy to render the diff for these four particular file extensions.\n\nNext, you need to tell Git about spaceman-diff. Do that by editing `~/.gitconfig`:\n\n```txt\n[diff \"spaceman-diff\"]\n  command = /path/to/spaceman-diff\n```\n\nAt this point, you should be ready to go. Try it out on a directory with an unstaged image change and run it with `git diff`.\n\n## contributing\n\n[Send a pull request][pull] with your changes, and make sure the tests pass. You can run dem tests with `./tests` in your working directory.\n\n## cool\n\nThis was cobbled together by [@holman](https://twitter.com/holman).\n\n[jp2a]:        https://csl.name/jp2a/\n[imagemagick]: http://www.imagemagick.org\n[brew]:        http://brew.sh\n[binary]:      https://github.com/holman/spaceman-diff/blob/master/spaceman-diff\n[pull]:        https://github.com/holman/spaceman-diff/pull/new/master\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholman%2Fspaceman-diff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fholman%2Fspaceman-diff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholman%2Fspaceman-diff/lists"}