Skip to content

LosadaT/image-processor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

ImageProcessor

Image processing and analysis application with a graphical interface, developed in C using SDL3.


Features

  • 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

Technologies Used

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

Build

make

Run

./image_processor <image_path>

Technical Implementation

Image Loading

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.

Grayscale Conversion

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.

Histogram Calculation

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)

Graphical Interface

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

Project Structure

.
├── src/        # Source code
├── include/    # Header files
└── build/      # Compiled files (generated by make)

Authors

About

Computer Vision course project

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors