# Adjusting Dark and White pixels values

Here is the definition which i read from the net source

1st is

Midtone: Situated between the darkest tone (Black), and the brightest tone (White). For a 24 bit colour image, this occurs when Red = Green = Blue = 128.

and the other is

Tones created by dots between 30% and 70% of coverage


and

Midtone also refers to the range of colors that aren't mixed with black (the shadows) or white (the highlights).

What i got from these definition is that the pixels whose values are 0 or 255 we should adjust them to 128 . Am i taking the definition right ? I don't want to use the way of Histogram Equalization as according to my knowledge its also use for brightness of image

I want to perform the function like below , like i want to perform this function in OpenCV C++ but i don't know the idea of how to deal with Midtones and CYMK values as it has both RGB and CMYK at the same time

For example Sample image

After applying the above values

I want to do the same in OpenCV

My concern is only with the result if we can perform this with only RGB

edit retag close merge delete