Skip to content

srikomm/BMP-EDITING

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 

Repository files navigation

BMP EDITING

This repo focuses on editing BMP images at pixel level using C. For ease of use I used QDBMP library. And for Grayscale techniques I followed Tanner Helland's article.

Original Image

fish.bmp

Negative


To get negative of an image, we just invert each color in each pixel of the image.

fish_neg.bmp

Greyscale

While converting a colored image to greyscale, a grey value is calculated from RGB values of the pixel and all the 3 RGB values are updated to the same grey value. This grey value depends upon the algorithm used. In this method grey value is simply the average of all 3 RGB values of a pixel.

fish_avg.bmp

This method uses an algorithm specified by the original ITU-R recommendation (BT.709, specifically) to calculate the grey value.

fish_luma.bmp

This method takes the average of the max and min values of a pixel and assigns it as the grey value.

fish_desaturation.bmp

There are two ways to decompose an image.

Max Decomposition

This uses the max value of all the 3 channels for the grey value.

fish_decomposition_max.bmp

Min Decomposition

This uses the min value of all the 3 channels for the grey value.

fish_decomposition_min.bmp

This method uses data from a single color channel.

SCC Red

This uses the red channel directly as gray.

fish_scc_red.bmp

SCC Green

This uses the green channel directly as gray.

fish_scc_green.bmp

SCC Blue

This uses the blue channel directly as gray.

fish_scc_blue.bmp

For better understanding of the SCC method, I am including another example here.

Original Image rgb.bmp

SCC Red rgb_red.bmp

SCC Green rgb_green.bmp

SCC Blue rgb_blue.bmp



In this method, the greyscale image is generated based on the number of shades of grey we define. As the number of shades of grey increases the image gets better and better.

2 shades of grey fish_2_shades_of_grey.bmp 3 shades of grey fish_3_shades_of_grey.bmp 4 shades of grey fish_4_shades_of_grey.bmp 8 shades of grey fish_8_shades_of_grey.bmp 16 shades of grey fish_16_shades_of_grey.bmp 32 shades of grey fish_32_shades_of_grey.bmp 64 shades of grey fish_64_shades_of_grey.bmp 128 shades of grey fish_128_shades_of_grey.bmp 256 shades of grey fish_256_shades_of_grey.bmp

Releases

No releases published

Packages

No packages published

Languages