photolab-pro-api / README.md
imran056's picture
Update README.md
a69cbf0 verified

A newer version of the Gradio SDK is available: 6.13.0

Upgrade
metadata
title: PhotoLab Pro API
emoji: 🎨
colorFrom: purple
colorTo: pink
sdk: gradio
sdk_version: 6.5.1
python_version: '3.11'
app_file: app.py
pinned: false
license: gpl-3.0

🎨 PhotoLab Pro API

AI-Powered Professional Photo Editing API with Gradio Interface

πŸš€ Features

πŸ“· Filters

  • Vintage: Classic vintage effect
  • Sepia: Warm sepia tone
  • Grayscale: Black and white
  • Warm: Warm color temperature
  • Cool: Cool color temperature
  • Blur: Gaussian blur
  • Sharpen: Image sharpening

βœ‚οΈ Background Removal

  • AI-powered background removal
  • Clean transparent PNG output
  • Works great for product photography

✨ Enhancement

  • Brightness: 0.5x to 2.0x
  • Contrast: 0.5x to 2.0x
  • Saturation: 0.0x to 2.0x
  • Sharpness: 0.0x to 2.0x

🎨 Art Styles

  • Van Gogh: Post-impressionist style
  • Picasso: Cubist style
  • Monet: Impressionist style
  • Kandinsky: Abstract style
  • Sketch: Pencil sketch effect
  • Cartoon: Cartoon/comic style

πŸ“Έ Portrait Mode

  • Professional background blur
  • Adjustable blur intensity
  • Subject detection and isolation

πŸ”§ Tools

  • Resize: Custom dimensions with aspect ratio option
  • Rotate: Any angle rotation
  • Crop: Square center crop
  • Grayscale Background: Color subject with gray background

πŸ’» API Usage

You can use this Space as an API:

from gradio_client import Client

client = Client("YOUR_USERNAME/photolab-pro-api")

# Apply filter
result = client.predict(
    image="path/to/image.jpg",
    filter_type="Vintage",
    api_name="/apply_filter"
)

# Remove background
result = client.predict(
    image="path/to/image.jpg",
    api_name="/remove_background"
)

# Enhance image
result = client.predict(
    image="path/to/image.jpg",
    brightness=1.2,
    contrast=1.1,
    saturation=1.3,
    sharpness=1.0,
    api_name="/enhance"
)

# Apply art style
result = client.predict(
    image="path/to/image.jpg",
    style="Van Gogh",
    api_name="/apply_art_style"
)

# Portrait mode
result = client.predict(
    image="path/to/image.jpg",
    blur_amount=21,
    api_name="/portrait_mode"
)

# Resize
result = client.predict(
    image="path/to/image.jpg",
    width=800,
    height=800,
    maintain_aspect=True,
    api_name="/resize"
)

# Rotate
result = client.predict(
    image="path/to/image.jpg",
    angle=90,
    api_name="/rotate"
)

# Crop to square
result = client.predict(
    image="path/to/image.jpg",
    api_name="/crop_square"
)

# Grayscale background
result = client.predict(
    image="path/to/image.jpg",
    api_name="/grayscale_background"
)

πŸ“Š API Endpoints

Endpoint Description
/apply_filter Apply image filters (Vintage, Sepia, Grayscale, Warm, Cool, Blur, Sharpen)
/remove_background Remove background with AI
/enhance Adjust brightness, contrast, saturation, sharpness
/apply_art_style Apply artistic styles (Van Gogh, Picasso, Monet, Kandinsky, Sketch, Cartoon)
/portrait_mode Create portrait mode effect with background blur
/resize Resize image to custom dimensions
/rotate Rotate image by specified angle
/crop_square Crop image to square shape
/grayscale_background Keep subject in color, make background grayscale

🎯 Use Cases

  • E-commerce: Product photography background removal
  • Social Media: Apply filters and effects
  • Photography: Professional image enhancement
  • Art: Create artistic versions of photos
  • Mobile Apps: Integrate photo editing features

πŸ”§ Technical Details

  • Framework: Gradio 4.16.0
  • Python: 3.11
  • AI Models: rembg for background removal
  • Image Processing: PIL, OpenCV, NumPy
  • Deployment: HuggingFace Spaces

πŸ“ License

GPL-3.0

πŸ™ Credits

Built with:

  • Gradio
  • rembg
  • Pillow
  • OpenCV

Made with ❀️ for the AI community