Image processing and analysis application with a graphical interface, developed in C using SDL3.
- Load and display images in multiple formats (PNG, JPEG, BMP, etc.)
- Grayscale conversion
- Automatic histogram calculation
- Image property analysis:
- Average light intensity
- Brightness classification
- Intensity standard deviation
- Contrast classification
- Interactive graphical interface powered by SDL3
| Technology | Purpose |
|---|---|
| C | Core application language |
| SDL3 | Window management, rendering, and GUI |
| SDL_image | Multi-format image loading |
| SDL_ttf | Text rendering in the interface |
| Make | Build system |
make./image_processor <image_path>Uses the SDL_image library to load images in multiple formats (PNG, JPEG, BMP, etc.). The image is stored in its original RGB format and converted to grayscale for analysis.
Each RGB pixel is converted to an 8-bit intensity value (0–255) using the formula:
Y = 0.2125 × R + 0.7154 × G + 0.0721 × B
Grayscale pixels are stored in a contiguous array to optimize memory access and subsequent calculations.
The histogram is computed by iterating over all pixels and recording the frequency of each intensity level (0–255). From the frequencies, the following are derived:
- Mean — weighted average of intensities
- Standard Deviation — measure of intensity dispersion
- Brightness — classified as light (≥ 170), medium (85–170), or dark (< 85)
- Contrast — classified as high (≥ 80), medium (30–80), or low (< 30)
Built with SDL3 and SDL_ttf for text rendering. The GUI displays:
- Original image visualization
- Histogram chart with frequency for each intensity level
- Statistical information and classifications
- Interactive buttons for user input
.
├── src/ # Source code
├── include/ # Header files
└── build/ # Compiled files (generated by make)