Change image levels quickly I have an image with a few shades of grey in it. I need to change some of those shades into white. Is there anything more efficient than going through each pixel one by one and check its RGB values? Is it perhaps possible to somehow posterize the image with some built-in function?
Blender is a bit limited as an image editor, you may find using an external image editor easier. One option is to use the compositor were masking nodes can be used to select a colour to use as a mask for other nodes.

As your asking with the tag of python, you can access the raw image data through bpy.data.images['img_name'].pixels[x]. This is a list of floats that makeup the pixel data, there are 4 per image pixel (red,green,blue,alpha). You can get the width and height through bpy.data.images['img_name'].size.

for p in bpy.data.images['img_name'].pixels:
    if p &lt; 0.45 and p &gt; 0.48:
        p = 0.2