Skip to content

ParsaHaghighatgoo/imageEditor-with-NetworkProtocols

Repository files navigation

Image Editor with Network Protocols

A powerful C-based image processing application that combines advanced image manipulation effects with network protocol capabilities for downloading and receiving images via email, URL (cURL), and socket connections.

πŸ“‹ Overview

This project was developed as part of a Computer Networks course at Shiraz University (Spring 2023) under the supervision of Dr. Ali Hamzeh. It demonstrates the integration of image processing algorithms with various network protocols, providing a comprehensive solution for downloading, processing, and editing images.

Authors: Ali Sharafian & Parsa Haghighatgoo
Contact: parsaali0002@gmail.com

✨ Features

Image Processing Effects

The application supports 20+ image effects for BMP, PNG, and JPG formats:

  • Color Adjustments:

    • Hue shift
    • Grayscale
    • Sepia
    • Warm color
    • Solarize
    • Revert/Invert colors
  • Artistic Effects:

    • Oil painting
    • Watercolor
    • Comic book style
    • Neon effect
    • Vintage (vin4)
  • Enhancement & Filters:

    • Sharpen
    • Motion blur
    • Noise addition
    • Brightness & Contrast (brn)
  • Creative Effects:

    • Cyberpunk (cybr)
    • Off-grid/Pixelate
    • Cross-hatch
    • Polygon
    • Mirror

Network Protocol Support

  • Email (IMAP): Download images from Gmail using IMAP protocol
  • HTTP via cURL: Download images from URLs using libcurl
  • HTTP via Socket: Download images using raw Windows socket programming
  • Local File System: Load images from local paths

User Interfaces

  • Command-line Interface (CLI): Full-featured C implementation
  • Graphical User Interface (GUI): PyQt5-based interface for easy interaction
  • PowerShell GUI: Alternative Windows PowerShell interface

πŸ› οΈ Technologies Used

  • Language: C (C11 standard)
  • Build System: CMake
  • Image Processing: stb_image, stb_image_write, stb_image_resize
  • Network Libraries:
    • libcurl (for HTTP/IMAP)
    • Winsock2 (for socket programming)
  • GUI Framework: PyQt5 (Python)
  • Platform: Windows

πŸ“¦ Prerequisites

Required Libraries

  1. libcurl - For HTTP and IMAP operations
  2. Winsock2 - For socket programming (included in Windows SDK)
  3. stb libraries - For image processing (header-only, included in project)

For Python GUI

  • Python 3.x
  • PyQt5
pip install PyQt5

πŸš€ Installation & Build

Building the C Application

  1. Clone the repository:
git clone https://github.com/ParsaHaghighatgoo/imageEditor-with-NetworkProtocols.git
cd imageEditor-with-NetworkProtocols
  1. Install dependencies:

    • Install libcurl for Windows
    • Ensure CMake is installed (version 3.24 or higher)
  2. Build with CMake:

mkdir build
cd build
cmake ..
cmake --build .
  1. Run the executable:
./networkingphotoshopproject.exe

Running the GUI

PyQt5 GUI:

python gui-qt.py

PowerShell GUI:

.\gui_powershell.ps1

πŸ“– Usage

Command-Line Interface

The main C application (main.c) provides an interactive menu system where you can:

  1. Choose input method (Email, URL-cURL, URL-Socket, or Local Path)
  2. Specify the image source
  3. Select desired image effects
  4. Process and save the edited image

Graphical User Interface

The PyQt5 GUI provides:

  • Image preview (before and after)
  • Effect selection via checkboxes
  • Input method selection via radio buttons (Email, URL-cURL, URL-Socket, Local Path)
  • Path/URL input field
  • One-click processing

Available Effects

Effect Description
hue Shift color hue values
solarize Solarization effect
revert Invert all colors
grayscale Convert to grayscale
sepia Apply sepia tone
brn Adjust brightness and contrast
offgrid Pixelation/grid effect
cybr Cyberpunk color effect
sharpen Sharpen image details
noise Add random noise
vin4 Vintage vignette effect
warmcolor Add warm color tones
oilpainting Oil painting artistic effect
motionblur Horizontal motion blur
cross Cross-hatch pattern
neon Neon glow effect
comic Comic book style
watercolor Watercolor painting effect
polygon Polygon distortion
mirror Horizontal mirror effect

πŸ”§ Configuration

Email Configuration (gmail.c)

To use the email download feature, update the credentials in gmail.c:

char email[] = "your-email@gmail.com";
char password[] = "your-app-password";  // Use Gmail App Password

Note: You need to enable "Less secure app access" or use an App Password for Gmail.

SSL Certificate

For HTTPS/IMAP connections, ensure you have the CA certificate bundle:

curl_easy_setopt(curl, CURLOPT_CAINFO, "path/to/cacert.pem");

πŸ“ Project Structure

imageEditor-with-NetworkProtocols/
β”œβ”€β”€ main.c                  # Main application with image effects
β”œβ”€β”€ gmail.c                 # Email download via IMAP
β”œβ”€β”€ url.c                   # URL download via sockets
β”œβ”€β”€ url_ms.c                # Alternative URL implementation
β”œβ”€β”€ gui-qt.py               # PyQt5 graphical interface
β”œβ”€β”€ guiQT.ui                # Qt Designer UI file
β”œβ”€β”€ quiqt.py                # Alternative Qt implementation
β”œβ”€β”€ gui_powershell.ps1      # PowerShell GUI
β”œβ”€β”€ CMakeLists.txt          # CMake build configuration
β”œβ”€β”€ stb_image.h             # Image loading library
β”œβ”€β”€ stb_image_write.h       # Image writing library
β”œβ”€β”€ stb_image_resize.h      # Image resizing library
└── README.md               # This file

πŸ“š Documentation

For detailed technical documentation, refer to:

  • latex-doc-networkingphotoshopproject)-parsahaghighatgooalisharafiyan.pdf - Complete project documentation
  • source of latex.txt - LaTeX source for documentation

🀝 Contributing

Contributions are welcome! Feel free to:

  • Report bugs
  • Suggest new features
  • Submit pull requests
  • Improve documentation

πŸ“ License

This project is open-source and available for educational purposes.

πŸŽ“ Academic Context

Course: Computer Networks
Institution: Shiraz University
Semester: Spring 2023
Instructor: Dr. Ali Hamzeh

πŸ“§ Contact

For questions, suggestions, or feedback:

πŸ™ Acknowledgments

  • stb libraries by Sean Barrett for image processing
  • libcurl for network protocol implementation
  • PyQt5 for GUI framework
  • Dr. Ali Hamzeh for project supervision

Note: This project was developed as an educational exercise to demonstrate the integration of image processing with network protocols. It showcases practical applications of HTTP, IMAP, and socket programming in C.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors