Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Developed with 🧠 by Shoaib Alam (AI Engineer at JPMC | NLP Researcher @ IIT Gandhinagar | Hybrid RAG Pioneer)

Sketchify - Image to Line Sketch Converter

A web application that transforms photos into beautiful line art sketches. Upload an image or capture one with your camera, and the app will remove the background and convert it into a clean line sketch.

Screenshots

Home Page

Home Page

Processing Results

Output with Cursor Control

Features

  • Upload Images: Drag & drop or click to upload images
  • Camera Capture: Take photos directly with your device camera
  • Background Removal: AI-powered background removal using rembg
  • Line Sketch Conversion: Clean edge detection using OpenCV
  • Download Results: Save both the background-removed image and the sketch

Tech Stack

  • Backend: Python Flask
  • Image Processing: OpenCV, rembg, Pillow
  • Frontend: HTML5, CSS3, JavaScript

Installation

  1. Clone or navigate to the project directory:

    cd Image_sketch
  2. Create a virtual environment (recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies:

    pip install -r requirements.txt

    Note: The first run will download the rembg AI model (~170MB), which may take a few minutes.

Running the App

  1. Start the Flask server:

    python app.py
  2. Open your browser and navigate to:

    http://localhost:5001
    

    Note: We use port 5001 because port 5000 is often used by macOS Control Center.

Usage

  1. Choose between Upload or Camera tab
  2. Select or capture an image
  3. Click Generate Sketch to process
  4. View the results and download your sketch

Keyboard Shortcuts

  • Ctrl/Cmd + Enter: Process image
  • Escape: Clear preview
  • Space: Capture photo (when camera is active)

Project Structure

Image_sketch/
├── app.py                 # Flask backend with image processing
├── requirements.txt       # Python dependencies
├── README.md              # This file
├── static/
│   ├── css/
│   │   └── style.css      # Modern dark theme styling
│   └── js/
│       └── main.js        # Frontend logic
└── templates/
    └── index.html         # Main UI template

How It Works

  1. Background Removal: Uses the rembg library which leverages a U2-Net model to isolate the subject from the background
  2. Edge Detection: Applies OpenCV's Canny edge detection algorithm to extract clean outlines
  3. Post-processing: Gaussian blur reduces noise, and edge dilation enhances line visibility

License

MIT License

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages