TL;DR Wavelength != Color
You can not since there is no one to one mapping. What you see on a monitor is three bumps on the spectral distribition. There is no color that your monitor displays that matches any of the wavelengths, only approximate to approximate conversion is possible even so many colors dont match anything.
The above plot shows relation to human vision and spectrum, the outermost edge is a pure spectral color. While the triangle is the sRGB gamut. As you see there is no point inside the triangle that is on the edge of the outermost edge.
More thorough explanation
Your under the assumption that color and wavelength is somehow the same thing. This is a common misconception. You have extrapolated a very simple explanation of how a rainbow is created from a prism. The exact incorrect conclusion that this is also true in reverse, its not! Its only one possible reverse out of untold combinations.
So following applies
- TRUE statement (meaninfully big) Change in a wavelength always changes perceived color.
But the reverse is not generally true:
- Following is FALSE (meaninfully big) Change in perceived color alway means change in wavelength
The light that you see around you is not composed of one wavelength, its composed of multiple wavelengths. Secondly our eyes don't see wavelengths. They build a signal out of a distribution of wavelengths.
Simply different wavelengths are lumped together into a 3 signal source. THere is no way of knowing what the original wavelength was. Because:
- It was not one wavelength to begin with
- Any number of different wavelength distributions can, and do make the same color. See wikipedia on metamerism
- Bulk of the colors we see are impossible colors in a rainbow.
So as a result our imaging applications don't record the wavelength data because that would explode our memory consumption its also dis interesting. So you can not say what wavelength is in a image if you put a filter that removes all wavelengths above some threshold. Since you don't know what wavelengths the image had in first place.
This is good, otherwise your monitor wouldnt work.
There exist cameras that can do this, they have special formats. But you don't have a camera that does, nor do you have any pictures on your computer that do, nor do you have a application on your computer that can even manage to display such pictures. Because such tools are rare and expensive indeed.