This project is a Django web application that transforms your images into beautiful artistic sketches and paintings using advanced computer vision techniques. If you find this repository helpful or interesting, please consider giving it a star⭐ and Follow Me for cool Projects
- It helps others discover the project.
- It motivates the me to keep improving it.
- It supports open-source development!
If you want to contribute, feel free to fork the repository and submit a pull request. Also, don’t forget to star the repo!
Thanks for your support! ❤
opencv + numpy image processing
-
14 Artistic Transformations - Convert images into various artistic styles:
- Edge Sketch
- Pen Sketch
- Pencil Sketch
- Watercolor Painting
- Oil Painting
- Charcoal Drawing
- Digital Painting
- Acrylic Painting
- Pen and Ink
- Spray Painting
- Tattoo Drawing
- Hatching Drawing
- Calligraphy/Marker Drawing
- 3D Drawing Effect
-
Modern UI/UX - Clean, responsive interface with Tailwind CSS
-
Drag-and-Drop - Easy image uploading
-
Real-time Processing - Quick transformation with loading indicators
-
Download Options - Save your favorite artistic renditions
- Backend: Django
- Image Processing: OpenCV, NumPy
- Frontend: HTML, CSS, JavaScript
- Styling: Tailwind CSS
- Icons: Font Awesome
The application leverages OpenCV's powerful image processing capabilities to apply various artistic transformations:
- Edge Detection Algorithms: Canny edge detection for sketch-like effects
- Bilateral Filtering: For oil painting and watercolor effects
- Texture Simulation: Random noise patterns for realistic art styles
- Morphological Operations: For various drawing styles
- Color Space Manipulation: HSV adjustments for vibrant digital art
- Adaptive Thresholding: For pen and ink drawing effects
- Python 3.6+
- pip
- Clone the repository:
git clone https://github.com/sayyedrabeeh/artist.git
cd sketch_project
- Create a virtual environment:
python -m venv venv
source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Run migrations:
python manage.py migrate
- Start the development server:
python manage.py runserver
- Open your browser and navigate to:
http://127.0.0.1:8000
sketch_project
|---- sketch_project/
├── sketchapp/ # Main Django app
│ ├── views.py # Contains image processing functions
│ ├── models.py # UploadedImage model
│ ├── forms.py # Image upload form
│ ├── templates/ # HTML templates
│ │ ├── home.html # Landing page
│ │ └── upload.html # Upload and results page
│ └── ...
├── media/ # Stores uploaded and processed images
├── static/ # Static files (CSS, JS)
├── manage.py
└── requirements.txt
The application implements various artistic algorithms:
- Edge Sketch: Uses Canny edge detection with dilation for clean line art
- Pen Sketch: Uses adaptive thresholding for a pen drawing effect
- Pencil Sketch: Combines inverted grayscale with Gaussian blur for realistic pencil texture
- Watercolor: Applies edge-preserving filter and stylization with paper texture
- Oil Painting: Uses bilateral filtering with sharpening for painterly strokes
- Digital Painting: Applies saturation enhancement and vignette effect
- Acrylic Painting: Combines bilateral filtering with noise textures
- Charcoal: Uses Laplacian edges with grainy texture and contrast adjustments
- Tattoo Drawing: Applies adaptive thresholding and edge emphasis
- Hatching: Creates cross-hatching patterns based on image intensity
- 3D Drawing: Combines depth maps with edge detection for dimensional effects
The application accepts JPG images of any size. Large images will be processed without resizing, which may take longer but preserves quality.
You can adjust various parameters in the image processing functions to modify the artistic effects. For example:
- Change
sigma_s
andsigma_r
in the watercolor function for different stylization levels - Adjust blur kernel sizes for more or less pronounced effects
- Modify contrast parameters for stronger or softer renditions
- Best Results: Upload clear images with good lighting and minimal noise
- Processing Time: Complex transformations like 3D Drawing may take longer
- Image Format: Only JPG images are supported currently
- Resolution: Higher resolution images produce more detailed artistic effects
- OpenCV for incredible image processing capabilities
- Django for the robust web framework
- TailwindCSS for the modern UI design
- Font Awesome for beautiful icons