No, they will not modify the mask in any way as far as my understanding goes. Since Brightness and Gamma are intensity based transformations. I am not sure why you are observing the a change in the mask values. Maybe you can double check your code.