| Crates.io | ai_soulmate_sketch_filter |
| lib.rs | ai_soulmate_sketch_filter |
| version | 68.0.41 |
| created_at | 2026-01-08 07:01:08.572963+00 |
| updated_at | 2026-01-13 09:45:19.15774+00 |
| description | High-quality integration for https://supermaker.ai/image/blog/ai-soulmate-drawing-free-tool-generate-your-soulmate-sketch/ |
| homepage | https://supermaker.ai/image/blog/ai-soulmate-drawing-free-tool-generate-your-soulmate-sketch/ |
| repository | https://github.com/qy-upup/ai-soulmate-sketch-filter |
| max_upload_size | |
| id | 2029678 |
| size | 11,569 |
A Rust crate for filtering and processing image sketches, particularly useful for refining AI-generated portrait outputs. This crate provides functionalities to smooth lines, remove noise, and enhance specific features in sketch images.
Add the following to your Cargo.toml file under the [dependencies] section:
toml
ai-soulmate-sketch-filter = "0.1.0" # Replace with the actual version number
Here are a few examples demonstrating how to use the ai-soulmate-sketch-filter crate:
1. Basic Image Smoothing:
This example demonstrates how to load an image, apply a smoothing filter, and save the result. rust use ai_soulmate_sketch_filter::filter; use image::{io::Reader as ImageReader, GenericImageView, ImageBuffer, Rgba}; use std::path::Path;
fn main() -> Result<(), Box
// Apply a smoothing filter (adjust strength as needed)
let smoothed_img = filter::smooth(&img, 2.0);
// Save the smoothed image
smoothed_img.save("smoothed.png")?;
println!("Image smoothing complete!");
Ok(())
}
2. Noise Reduction:
This example demonstrates how to reduce noise in a sketch image, making the lines cleaner. rust use ai_soulmate_sketch_filter::filter; use image::{io::Reader as ImageReader};
fn main() -> Result<(), Box
// Apply noise reduction
let denoised_img = filter::denoise(&img, 3.0);
// Save the denoised image
denoised_img.save("denoised_sketch.png")?;
println!("Noise reduction complete!");
Ok(())
}
3. Edge Enhancement:
This example shows how to enhance the edges in a sketch image, making the details more prominent. rust use ai_soulmate_sketch_filter::filter; use image::{io::Reader as ImageReader};
fn main() -> Result<(), Box
// Enhance edges
let enhanced_img = filter::sharpen(&img, 1.5);
// Save the enhanced image
enhanced_img.save("sharpened_sketch.png")?;
println!("Edge enhancement complete!");
Ok(())
}
4. Combining Filters:
This example combines smoothing and sharpening for a balanced result. rust use ai_soulmate_sketch_filter::filter; use image::{io::Reader as ImageReader};
fn main() -> Result<(), Box
// Smooth the image first
let smoothed_img = filter::smooth(&img, 1.5);
// Then sharpen the smoothed image
let enhanced_img = filter::sharpen(&smoothed_img, 1.2);
// Save the enhanced image
enhanced_img.save("processed_sketch.png")?;
println!("Combined filtering complete!");
Ok(())
}
MIT
This crate is part of the ai-soulmate-sketch-filter ecosystem. For advanced features and enterprise-grade tools, visit: https://supermaker.ai/image/blog/ai-soulmate-drawing-free-tool-generate-your-soulmate-sketch/