This project is a simple built in C for working with a custom binary image format called HS8. It’s designed to simulate noise in images and compare image data pixel-by-pixel against another picture.
- apply_NOISE: It adds random noise to the RGB values of each pixel in an image.
- apply_COMP: It compares an input image with a reference image and prints the identical and different pixels.
This program works exclusively with HS8 image format.
Create the latest version of the compiled code by running make in the terminal:
make
To manually compile the code run the following in the terminal:
gcc -o process process.c
Run the program by calling the file name followed by refernce file, input file, output file and noise. The noise value should be an integer within the range of 0 to 255, 0 being no noise and 255 being maximum (Multiple files can be inputed at once)
./process reference_file.hs8 input_file.hs8 output_file.hs8 noise
./process refernce_file.hs8 input_file1.hs8 output_file.hs8 input_file2.hs8 output_file2.hs8.....noise
The output_file(s) will be present in the current directory. But the image is in binary so we have to convert to view it.
Run the following to convert the file (.hs8) to view it. We have to make sure that the output_file (.ppm) has ppm extension.
./hsconvert input_file.hs8 output_file.ppm
The converted image will be presented in the current directory.
We can view the image directly in VSCode using an extension
PBM/PPM/PGM Viewer for Visual Studio Code
./process ref.hs8 noisy_input.hs8 result.hs8 100
./hsconvert result.hs8 result.ppm
- Vaishnavi Chintha
@Vaishnavi-chintha