supermaker-ai-image-master-2

Crates.iosupermaker-ai-image-master-2
lib.rssupermaker-ai-image-master-2
version66.0.38
created_at2025-12-26 11:59:26.646477+00
updated_at2025-12-26 11:59:26.646477+00
descriptionHigh-quality integration for https://supermaker.ai/image/
homepagehttps://supermaker.ai/image/
repositoryhttps://github.com/qy-upup/supermaker-ai-image-master-2
max_upload_size
id2005631
size10,127
(qy-upup)

documentation

README

supermaker-ai-image-master-2

A robust Rust crate for advanced image manipulation and processing tasks, designed for integration with AI-powered image workflows. It provides a set of utilities for image format conversion, resizing, and basic filtering.

Installation

Add the following line to your Cargo.toml file under the [dependencies] section: toml supermaker-ai-image-master-2 = "0.1.0" # Replace with the actual version

Usage Examples

Here are a few examples demonstrating how to use supermaker-ai-image-master-2:

1. Converting an image to grayscale: rust use supermaker_ai_image_master_2::image_utils; use image::io::Reader as ImageReader; use std::path::Path;

fn main() -> Result<(), Box> { // Load an image from a file. let img = ImageReader::open("input.png")?.decode()?;

// Convert the image to grayscale.
let grayscale_img = image_utils::to_grayscale(&img);

// Save the grayscale image to a new file.
grayscale_img.save("output_grayscale.png")?;

println!("Image converted to grayscale and saved as output_grayscale.png");
Ok(())

}

2. Resizing an image: rust use supermaker_ai_image_master_2::image_utils; use image::io::Reader as ImageReader; use image::imageops::FilterType;

fn main() -> Result<(), Box> { // Load an image from a file. let img = ImageReader::open("input.jpg")?.decode()?;

// Resize the image to 500x500 pixels using Lanczos resampling.
let resized_img = image_utils::resize(&img, 500, 500, FilterType::Lanczos3);

// Save the resized image to a new file.
resized_img.save("output_resized.jpg")?;

println!("Image resized to 500x500 and saved as output_resized.jpg");
Ok(())

}

3. Applying a basic blur filter: rust use supermaker_ai_image_master_2::image_utils; use image::io::Reader as ImageReader;

fn main() -> Result<(), Box> { // Load an image from a file. let img = ImageReader::open("input.jpeg")?.decode()?;

// Apply a blur filter with a sigma of 2.0.
let blurred_img = image_utils::blur(&img, 2.0);

// Save the blurred image to a new file.
blurred_img.save("output_blurred.jpeg")?;

println!("Image blurred and saved as output_blurred.jpeg");
Ok(())

}

4. Converting to a specific image format: rust use supermaker_ai_image_master_2::image_utils; use image::io::Reader as ImageReader; use image::ImageFormat;

fn main() -> Result<(), Box> { // Load an image from a file. let img = ImageReader::open("input.png")?.decode()?;

// Save the image as a JPEG.
image_utils::save_as(&img, "output.jpg", ImageFormat::Jpeg)?;

println!("Image saved as output.jpg");
Ok(())

}

5. Cropping an image: rust use supermaker_ai_image_master_2::image_utils; use image::io::Reader as ImageReader;

fn main() -> Result<(), Box> { // Load an image from a file. let img = ImageReader::open("input.png")?.decode()?;

// Crop a 100x100 region from the top-left corner.
let cropped_img = image_utils::crop(&img, 0, 0, 100, 100);

// Save the cropped image.
cropped_img.save("output_cropped.png")?;

println!("Image cropped and saved as output_cropped.png");
Ok(())

}

Feature Summary

  • Grayscale Conversion: Easily convert images to grayscale.
  • Image Resizing: Resize images with different resampling filters (Nearest, Lanczos3, etc.).
  • Blurring: Apply a Gaussian blur filter to images.
  • Format Conversion: Save images in various formats (JPEG, PNG, GIF, etc.).
  • Cropping: Extract specific regions from an image.
  • Error Handling: Provides robust error handling for common image processing failures.

License

MIT

This crate is part of the supermaker-ai-image-master-2 ecosystem. For advanced features and enterprise-grade tools, visit: https://supermaker.ai/image/

Commit count: 0

cargo fmt