Skip to content

tarxemo/Images_Resolution

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“ธ๐ŸŽฌ Django Image & Video Enhancement System

A full-stack Django application that allows users to register, upload images and videos, and automatically enhance their quality using OpenCV, PIL, MoviePy, and NumPy. The system supports:

  • User authentication (register, login, logout)
  • Image enhancement (upscaling, denoising, sharpening, color boost)
  • Video enhancement (frame-by-frame processing + audio preservation)
  • Media management (upload, list, delete)
  • Per-user image & video library

This README explains the setup, features, project structure, and usage.


๐Ÿš€ Features

๐Ÿ” Authentication

  • User registration
  • Login & logout
  • Login-required protection for media pages

๐Ÿ“ธ Image Enhancement Pipeline

Every image uploaded goes through:

  1. Upscaling (ร—3 using Lanczos interpolation)
  2. Denoising (Bilateral filter)
  3. Sharpening (Unsharp mask)
  4. Contrast & brightness adjustment
  5. Color saturation enhancement
  6. Saves both original & high-quality versions

๐ŸŽฌ Video Enhancement Pipeline

Each frame is processed using the following:

  1. Upscaling (ร—3)
  2. Denoising for small frames
  3. Sharpening
  4. Brightness & contrast improvement
  5. Color enhancement
  6. Audio preserved using MoviePy

๐Ÿ“ User Media Dashboard

  • List all your images
  • List all your videos
  • View enhanced results
  • Delete media

๐Ÿ“ฆ Tech Stack

Area Technology
Backend Django
Media Processing OpenCV, Pillow, NumPy, MoviePy
Frontend HTML, CSS, JavaScript (AJAX JSON response)
Database SQLite / PostgreSQL
Authentication Django Auth System

๐Ÿ“‚ Project Structure (Relevant Parts)

your_project/
โ”‚
โ”œโ”€โ”€ media/                  # Stores uploaded and enhanced media
โ”‚
โ”œโ”€โ”€ app_name/
โ”‚   โ”œโ”€โ”€ models.py           # UploadedImage & UploadedVideo models
โ”‚   โ”œโ”€โ”€ views.py            # (Your provided code)
โ”‚   โ”œโ”€โ”€ forms.py
โ”‚   โ”œโ”€โ”€ urls.py
โ”‚   โ”œโ”€โ”€ templates/
โ”‚       โ”œโ”€โ”€ index.html
โ”‚       โ”œโ”€โ”€ login.html
โ”‚       โ”œโ”€โ”€ register.html
โ”‚       โ”œโ”€โ”€ home.html
โ”‚       โ”œโ”€โ”€ video_home.html
โ”‚       โ”œโ”€โ”€ upload.html
โ”‚       โ”œโ”€โ”€ upload_video.html
โ”‚
โ””โ”€โ”€ requirements.txt

โš™๏ธ Installation & Setup

1. Clone the Repository

git clone https://github.com/yourusername/yourrepo.git
cd yourrepo

2. Create and Activate Virtual Environment

python3 -m venv venv
source venv/bin/activate   # Linux/Mac
venv\Scripts\activate      # Windows

3. Install Dependencies

pip install -r requirements.txt

Required packages include:

Django
opencv-python
pillow
numpy
moviepy
scikit-image

4. Apply Migrations

python manage.py migrate

5. Create Superuser (optional)

python manage.py createsuperuser

6. Run Development Server

python manage.py runserver

Visit:

http://127.0.0.1:8000/

๐Ÿ–ผ๏ธ Image Enhancement Flow

When a user uploads an image:

  1. Stored temporarily
  2. Enhanced using:
upscale_image(image, scale_factor=3)
apply_denoising(image)
apply_sharpening(image)
adjust_contrast_brightness(image)
enhance_color(image)
  1. Saved as:

    original_image.jpg
    high_quality_original_image.jpg
    
  2. Returns JSON:

{
  "original_image_url": "...",
  "high_quality_image_url": "..."
}

๐ŸŽฌ Video Enhancement Flow

Video is processed frame by frame:

  1. Extract each frame with OpenCV
  2. Enhance with same pipeline as images
  3. Save enhanced video (temporary)
  4. Add original audio using MoviePy
  5. Save as:
original.mp4
high_quality_original.mp4

๐Ÿ”ง API Endpoints

Image Endpoints

URL Method Description
/upload/ POST Upload & enhance image
/home/ GET List user images
/delete-image/<id>/ POST Delete image

Video Endpoints

URL Method Description
/upload-video/ POST Upload & enhance video
/video-home/ GET List user videos
/delete-video/<id>/ POST Delete video

Authentication

URL Description
/register/ Create account
/login/ Login
/logout/ Logout

๐Ÿ’พ Models Summary

UploadedImage

  • user
  • original_image
  • high_quality_image
  • uploaded_at

UploadedVideo

  • user
  • original_video
  • high_quality_video
  • uploaded_at

๐Ÿ›ก๏ธ Authentication & Security

  • Uses Django built-in auth system
  • CSRF protection enabled except AJAX upload
  • Access to images/videos is user-restricted

๐Ÿ”ฎ Future Improvements (Optional)

  • Add progress bar during enhancement
  • Support batch processing
  • Integrate WebSockets for real-time progress updates
  • Add AI-based super resolution (ESRGAN)

๐Ÿ“œ License

MIT License โ€” free to use, modify, and distribute.


About

Django application to boost the resolutions of images for easy image visibility and clear images

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors