Skip to content
Snippets Groups Projects
Verified Commit 6ddb528b authored by Louis's avatar Louis :fire:
Browse files

Update crate info

parent beec3fa7
No related branches found
No related tags found
No related merge requests found
Pipeline #339 waiting for manual action with stages
in 45 seconds
......@@ -174,7 +174,7 @@ dependencies = [
[[package]]
name = "crunch-cli"
version = "0.5.0"
version = "0.5.1"
dependencies = [
"anyhow",
"clap",
......
[package]
name = "crunch-cli"
version = "0.5.0"
version = "0.5.1"
edition = "2021"
homepage = "https://microhacks.lcr.app/crunch/"
repository = "https://lab.lcr.gr/microhacks/crunch"
license = "GPL-3.0"
description = "Command line asset manipulation, set up a pipeline once and run it against all of your files"
authors = [
......
......@@ -2,6 +2,8 @@
Command line image manipulation, set up a pipeline once and run it against all of your assets
For more info, check out [the docs](https://microhacks.lcr.app/crunch)
## Usage
Crunch takes an image and applies a transformation to it. But what if you want to do **two** transformations?
......
......@@ -12,7 +12,7 @@ use crate::load_image;
#[derive(Parser, Debug, Clone, Serialize, Deserialize)]
#[clap(name = "crunch")]
#[clap(author = "Louis Capitanchik <louis@microhacks.co.uk>")]
#[clap(version = "0.5.0")]
#[clap(version = "0.5.1")]
#[clap(about, long_about = None)]
#[serde(tag = "command", content = "params")]
pub enum Args {
......@@ -80,20 +80,20 @@ impl Args {
.save_with_format(&flip.output, ImageFormat::Png)
.map_err(anyhow::Error::from)
}
Args::Remap(remap) => {
let image_data = load_image(&remap.input, None)?;
let palette_data = load_image(&remap.palette, None)?;
let image_palette = Palette::extract_from(&image_data)?;
let target_palette = Palette::extract_from(&palette_data)?;
let mappings = Palette::calculate_mapping(&image_palette, &target_palette);
let output = Remap::remap_image(image_data, mappings)?;
output
.save_with_format(&remap.output, ImageFormat::Png)
.map_err(anyhow::Error::from)
}
// Args::Remap(remap) => {
// let image_data = load_image(&remap.input, None)?;
// let palette_data = load_image(&remap.palette, None)?;
//
// let image_palette = Palette::extract_from(&image_data)?;
// let target_palette = Palette::extract_from(&palette_data)?;
//
// let mappings = Palette::calculate_mapping(&image_palette, &target_palette);
// let output = Remap::remap_image(image_data, mappings)?;
//
// output
// .save_with_format(&remap.output, ImageFormat::Png)
// .map_err(anyhow::Error::from)
// }
Args::Reduce(reduce) => {
if let Some(amount) = reduce.colours {
log::info!("Num cols {}", amount);
......@@ -108,6 +108,7 @@ impl Args {
split.run(&image)
}
Args::Pipeline(pipeline) => pipeline.execute(),
_ => Ok(()),
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment