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.
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
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
- 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
- Command-line Interface (CLI): Full-featured C implementation
- Graphical User Interface (GUI): PyQt5-based interface for easy interaction
- PowerShell GUI: Alternative Windows PowerShell interface
- 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
- libcurl - For HTTP and IMAP operations
- Winsock2 - For socket programming (included in Windows SDK)
- stb libraries - For image processing (header-only, included in project)
- Python 3.x
- PyQt5
pip install PyQt5- Clone the repository:
git clone https://github.com/ParsaHaghighatgoo/imageEditor-with-NetworkProtocols.git
cd imageEditor-with-NetworkProtocols-
Install dependencies:
- Install libcurl for Windows
- Ensure CMake is installed (version 3.24 or higher)
-
Build with CMake:
mkdir build
cd build
cmake ..
cmake --build .- Run the executable:
./networkingphotoshopproject.exepython gui-qt.py.\gui_powershell.ps1The main C application (main.c) provides an interactive menu system where you can:
- Choose input method (Email, URL-cURL, URL-Socket, or Local Path)
- Specify the image source
- Select desired image effects
- Process and save the edited image
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
| 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 |
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 PasswordNote: You need to enable "Less secure app access" or use an App Password for Gmail.
For HTTPS/IMAP connections, ensure you have the CA certificate bundle:
- Download from: https://curl.se/docs/caextract.html
- Update the path in
gmail.c:
curl_easy_setopt(curl, CURLOPT_CAINFO, "path/to/cacert.pem");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
For detailed technical documentation, refer to:
latex-doc-networkingphotoshopproject)-parsahaghighatgooalisharafiyan.pdf- Complete project documentationsource of latex.txt- LaTeX source for documentation
Contributions are welcome! Feel free to:
- Report bugs
- Suggest new features
- Submit pull requests
- Improve documentation
This project is open-source and available for educational purposes.
Course: Computer Networks
Institution: Shiraz University
Semester: Spring 2023
Instructor: Dr. Ali Hamzeh
For questions, suggestions, or feedback:
- 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.