Gamma correction and halftone I'm writing a halftone algorithm, which takes standards RGB intensities in the range of $0-255$ and outputs black and white elements with a corresponding size ratio.

Should I apply a gamma expansion on the input luminance to get the ratio?

I.e. is it correct to do the following?

$\frac{w_\text{white}}{w_\text{white}+w_\text{black}} = (0.299 R + 0.587 G + 0.114 B)^{2.2}$

Should I apply the exponent of $2.2$?
Yes and no. The RGB values are most likely gamma compressed.

Consider gamma calibration images like the one below.

For a well calibrated monitor the gray value should look the same as the pattern of black and white lines.

If you load in the image you will likely find RGB values of $186$. 

$(186/255)^{2.2} \approx 0.5$, which means that a halftone pattern of black and white lines of equal width correspond to RGB values of 186.





However, the gamma compression applied was more likely the sRGB gamma compression than an overall gamma of $2.2$.

$$
\frac{w_\text{white}}{w_\text{white}+w_\text{black}} =
\begin{cases}
12.92V  &amp;\text{ if } V \leq 0.0031308 \\
1.055 V^{1/2.4} + 0.055 &amp;\text{ if } V &gt; 0.0031308 
\end{cases}
$$

where $V = 0.299R+0.587G+0.114B$