Introduction
Crunch is an open source, GPL-3.0 licensed command line tool written in Rust for manipulating assets, designed to complement a game development asset pipeline. Commands can either be executed directly, or can be executed via pipeline files.
Quick Installation
If you're using Linux or Windows, you can download the pre-built binaries, copy them to your path and get going:
Check the installation page for more ways of sourcing your version of Crunch, including installing from source on other platforms.
Basic Usage
After you've installed the binary, you can use the crunch
command to start manipulating assets. Check out the
help for a given command with crunch <command> --help
, or by checking the link in the sidebar that correlates to the
command you want to run.
Usage: crunch <COMMAND>
Commands:
rotate Rotate an image clockwise by the given degree
extrude Take each tile in an image and expand its borders by a given amount. Optionally fill with nearby pixels instead of empty space
palette Create a palette file containing every distinct colour from the input image
scale Resize an image by a scale factor
flip Flip an image along one or more axis
remap Convert the colour space of an image to that of a given palette file
pipeline Execute a predefined pipeline
reduce Limit the number of colours by quantity or threshold
split Take a spritesheet and split into individual sprites, skipping empty space
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
-V, --version Print version
Updating from 0.4 to 0.5
0.5.0
contains a breaking change to the argument order for commands. From 0.5
onwards, the command being
executed is now specified before the input and output file paths. This is because some commands don't use
both an input and an output, causing version 0.4
and lower to require a dummy value in those locations.
For Example:
- 0.4:
crunch ./myimage.png ./myimage-flipped.png flip -d both
- 0.5:
crunch flip -d both ./myimage.png ./myimage-flipped.png