Comparing pixels against RGB value in NumPy
Your original code can be rewritten as:

mask = np.all(img == (255, 127, 63), axis=-1)


It is a little cleaner, but not more efficient, as it still has to allocate a mask of the same size as the image.