Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dmamakas2000/filter-ppm-cpp
An academic project featuring a PPM image editor with custom 2D data representation, file handling, and image processing filters using C++. Supports reading, writing, and parametric transformations via runtime arguments. Highlights core concepts in image manipulation and data management.
https://github.com/dmamakas2000/filter-ppm-cpp
2darrays cpp filter functions image-processing inheritance mathematics ppm-image
Last synced: 25 days ago
JSON representation
An academic project featuring a PPM image editor with custom 2D data representation, file handling, and image processing filters using C++. Supports reading, writing, and parametric transformations via runtime arguments. Highlights core concepts in image manipulation and data management.
- Host: GitHub
- URL: https://github.com/dmamakas2000/filter-ppm-cpp
- Owner: dmamakas2000
- Created: 2023-08-13T20:34:23.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-11-27T20:26:28.000Z (about 1 month ago)
- Last Synced: 2024-11-27T21:25:39.654Z (about 1 month ago)
- Topics: 2darrays, cpp, filter, functions, image-processing, inheritance, mathematics, ppm-image
- Language: C++
- Homepage:
- Size: 63.5 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PPM Image Editor: A Custom Image Processing Application :camera: :computer:
## π’Noteπ’
π―Please, clone this repository before reading the description. Don't forget to likeπand share your thoughtsπ.
## About
This repository demonstrates an image editing application developed as part of an academic assignment. The project includes the implementation of a generic 2D data representation class, extended to handle images in the PPM format. Core functionality involves reading and writing PPM files via a custom library, enabling efficient image storage and retrieval. Additionally, a suite of image processing filters is provided, allowing users to apply transformations parametrically by passing arguments at runtime. This project showcases fundamental concepts in data representation, file handling, and image manipulation.## Filters
The application supports two different filter implementations. Each filter is represented using a different class.### Linear Filter
**FilterLinear** class applies to each pixel $pp(xx, yy)$ of the input image (right operator) the following formula:$ppβ²(xx, yy) = aa β pp(xx, yy) + cc$
Where $ppβ²(xx, yy)$ represents the pixel in the coordinate $(x,y)$ of the image created and returned by operator and $a$, $c$ two fixed vector values. For example, if $aa = (-1, -1, -1)$ and
$cc = (1, 1, 1)$ the filter should produce the negative of the original image. Please note that values of $a$ and $c$ should be restricted to the interval [0,1] for each channel colour channel.### Gramma Filter
**FilterGramma** implements the following operation:$ppβ²(xx, yy) = pp(xx, yy)^v$
Where each colour channel of a pixel is raised to the exponent $v$. Typical values for $v$ range between 0,5 and 2,0.
## How It Works
The following pattern displays the way the application is executed:```filter -f [filter 1] [parameters] ... -f [filter k] [parameters] [parameters] [image file name]```
The ```-f``` specifier is followed by the name of the filter, which can be either ```linear``` or ```gamma```, and immediately after a series of arguments corresponding to the specialized parameters of each filter. The ```linear``` filter should be followed by 6 float numbers corresponding to to the coordinates of the and $a$, $c$ vectors. The ```gamma``` filter shall be followed by 1 parameter which corresponding to the exponent $v$.
The input image filename is always given last. If no filter is given, the application immediately terminates. If no file is specified or no filter name is given correctly, the application immediately terminates as well. The number of filters and their type is determined at runtime based on the parameters taken by the application from the command line. Also, a filter may be applied multiple times and with different parameters each time. The order of application of filters is from left to right. Three examples follow.
- ```filter -f gamma 2.0 -f linear -1 -1 -1 1 1 1 image01.ppm```
- ```filter -f gamma 2.0 -f gamma 0.5 image01.ppm```
- ```filter βf gamma 0.7 -f linear 1 0.8 0.3 0.1 0.1 0.3 βf gamma 1.2 image02.ppm```## Project Structure
```
filter-ppm-cpp/
β
βββ src/ # Source code files
β βββ PPMParser.cpp # Core implementation for parsing PPM images
β βββ PPMParser.h # Header file for the parser
β βββ PPMFilter.cpp # Implementation of image filtering functions
β
βββ include/ # Additional headers (if applicable)
β βββ PPMFilter.h # Header file for filtering operations
β
βββ examples/ # Example PPM files
β βββ pole.ppm # A sample PPM image
β βββ pole.pgm # A sample PGM image
β
βββ build/ # Build files and Visual Studio configurations
β βββ PPMParserProject.sln # Visual Studio solution file
β βββ PPMParserProject.vcxproj # Visual Studio project file
β βββ PPMParserProject.filters # Project filters for organization
β βββ Debug/ # Debug binaries and temporary files
```## License
This project is licensed under the **MIT License** - see the **[LICENSE](LICENSE)** file for details.