ai_minecraft_image

Crates.ioai_minecraft_image
lib.rsai_minecraft_image
version68.0.18
created_at2026-01-08 03:44:34.833304+00
updated_at2026-01-13 09:44:14.185169+00
descriptionHigh-quality integration for https://supermaker.ai/image/blog/how-to-turn-your-image-into-minecraft-skin/
homepagehttps://supermaker.ai/image/blog/how-to-turn-your-image-into-minecraft-skin/
repositoryhttps://github.com/qy-upup/ai-minecraft-image
max_upload_size
id2029490
size12,194
(qy-upup)

documentation

README

ai-minecraft-image

A Rust crate to process images for use as Minecraft skins, providing utilities for resizing, color manipulation, and format conversion. This library simplifies the creation of custom Minecraft skins from existing images.

Installation

Add the following to your Cargo.toml file under the [dependencies] section: toml ai-minecraft-image = "0.1.0" # Replace with the latest version

Usage Examples

Here are several examples demonstrating how to use the ai-minecraft-image crate:

1. Basic Image Resizing:

This example demonstrates resizing an image to the standard Minecraft skin dimensions (64x64). rust use ai_minecraft_image::{resize_image, ImageFormat}; use image::io::Reader as ImageReader;

fn main() -> Result<(), Box> { let img = ImageReader::open("input.png")?.decode()?; let resized_img = resize_image(&img, 64, 64)?; resized_img.save_with_format("output.png", ImageFormat::Png.into())?; Ok(()) }

2. Converting to Grayscale:

This example converts an image to grayscale before resizing it. rust use ai_minecraft_image::{resize_image, grayscale, ImageFormat}; use image::io::Reader as ImageReader;

fn main() -> Result<(), Box> { let img = ImageReader::open("input.png")?.decode()?; let grayscale_img = grayscale(&img); let resized_img = resize_image(&grayscale_img, 64, 64)?; resized_img.save_with_format("output.png", ImageFormat::Png.into())?; Ok(()) }

3. Applying a Color Filter:

This example applies a red color filter to the image. rust use ai_minecraft_image::{resize_image, apply_color_filter, ImageFormat, Color}; use image::io::Reader as ImageReader;

fn main() -> Result<(), Box> { let img = ImageReader::open("input.png")?.decode()?; let filtered_img = apply_color_filter(&img, Color { r: 255, g: 0, b: 0 }); let resized_img = resize_image(&filtered_img, 64, 64)?; resized_img.save_with_format("output.png", ImageFormat::Png.into())?; Ok(()) }

4. Converting to a Specific Image Format:

This example resizes an image and saves it as a JPEG. rust use ai_minecraft_image::{resize_image, ImageFormat}; use image::io::Reader as ImageReader;

fn main() -> Result<(), Box> { let img = ImageReader::open("input.png")?.decode()?; let resized_img = resize_image(&img, 64, 64)?; resized_img.save_with_format("output.jpg", ImageFormat::Jpeg.into())?; Ok(()) }

5. Combining Operations:

This example combines grayscale conversion, color filtering (blue), and resizing. rust use ai_minecraft_image::{resize_image, grayscale, apply_color_filter, ImageFormat, Color}; use image::io::Reader as ImageReader;

fn main() -> Result<(), Box> { let img = ImageReader::open("input.png")?.decode()?; let grayscale_img = grayscale(&img); let filtered_img = apply_color_filter(&grayscale_img, Color { r: 0, g: 0, b: 255 }); let resized_img = resize_image(&filtered_img, 64, 64)?; resized_img.save_with_format("output.png", ImageFormat::Png.into())?; Ok(()) }

Feature Summary

  • Image Resizing: Easily resize images to the required dimensions for Minecraft skins.
  • Grayscale Conversion: Convert images to grayscale for a classic look.
  • Color Filtering: Apply color filters to modify the image's color palette.
  • Format Conversion: Save images in various formats (PNG, JPEG, etc.) supported by the image crate.
  • Easy Integration: Simple API for seamless integration into your Rust projects.

License

MIT

This crate is part of the ai-minecraft-image ecosystem. For advanced features and enterprise-grade tools, visit: https://supermaker.ai/image/blog/how-to-turn-your-image-into-minecraft-skin/

Commit count: 0

cargo fmt