ai-soulmate-sketch-filter
A powerful Elixir library for filtering and enhancing AI-generated soulmate sketches. This package provides a suite of tools to process and refine images produced by AI soulmate sketch generators.
Installation
To install ai-soulmate-sketch-filter, add it as a dependency to your mix.exs file:
elixir
def deps do
[
{:ai_soulmate_sketch_filter, "~> 0.1.0"} # Replace with the actual version] end
Then, run mix deps.get to fetch the dependency.
Usage Examples
Here are a few examples demonstrating how to use ai-soulmate-sketch-filter in your Elixir projects.
1. Basic Image Filtering: elixir alias AiSoulmateSketchFilter.ImageProcessor
image_path = "path/to/your/soulmate_sketch.jpg"
case ImageProcessor.filter(image_path) do {:ok, filtered_image_path} ->
IO.puts "Image filtered successfully. Saved to: #{filtered_image_path}"->
IO.puts "Error filtering image: #{reason}"end
2. Applying a Specific Filter with Custom Options: elixir alias AiSoulmateSketchFilter.ImageProcessor
image_path = "path/to/your/soulmate_sketch.jpg"
options = %{ :brightness => 1.2, :contrast => 1.1 }
case ImageProcessor.filter(image_path, :enhance, options) do {:ok, enhanced_image_path} ->
IO.puts "Image enhanced successfully. Saved to: #{enhanced_image_path}"->
IO.puts "Error enhancing image: #{reason}"end
3. Chaining Filters with the Pipe Operator: elixir alias AiSoulmateSketchFilter.ImageProcessor
image_path = "path/to/your/soulmate_sketch.jpg"
image_path |> ImageProcessor.filter(:grayscale) |> ImageProcessor.filter(:blur, %{radius: 2}) |> case do {:ok, blurred_grayscale_image_path} ->
IO.puts "Image processed successfully. Saved to: #{blurred_grayscale_image_path}"->
IO.puts "Error processing image: #{reason}"end
4. Identifying Facial Features: elixir alias AiSoulmateSketchFilter.FeatureDetection
image_path = "path/to/your/soulmate_sketch.jpg"
case FeatureDetection.detect_features(image_path) do {:ok, features} ->
IO.puts "Detected facial features: #{inspect(features)}"
# Features will contain information about eyes, nose, mouth, etc.->
IO.puts "Error detecting features: #{reason}"end
5. Handling Different Image Types: elixir alias AiSoulmateSketchFilter.ImageProcessor
image_path_jpg = "path/to/your/soulmate_sketch.jpg" image_path_png = "path/to/your/soulmate_sketch.png"
case ImageProcessor.filter(imagepath_jpg) do {:ok, } -> IO.puts "JPG Image processed" {:error, reason} -> IO.puts "JPG Image processing error: #{reason}" end
case ImageProcessor.filter(imagepath_png) do {:ok, } -> IO.puts "PNG Image processed" {:error, reason} -> IO.puts "PNG Image processing error: #{reason}" end
Feature Summary
- Image Filtering: Offers various image filters like grayscale, blur, and sharpen.
- Image Enhancement: Provides tools to adjust brightness, contrast, and saturation.
- Facial Feature Detection: Capable of identifying key facial features in the sketch.
- Error Handling: Robust error handling with informative error messages.
- Pipeline Support: Designed to work seamlessly with Elixir's pipe operator for chaining operations.
- Format Support: Supports common image formats like JPG and PNG.
License
MIT
This package 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/