Here is a little hint about a function that might be a bit hidden. If you quickly want to mask certain pixels or colors from being modified then key “e” is your friend.
Hold “e” and draw with left mouse button to define pixels that may be modified. All others will be masked and modifications are blocked. Use right mouse button to mask pixels additionally. Release “e” to finish.
To do this for color indexes instead of single pixels press and release “e”. Now you are in stencil definition mode. This way you select with the left mouse button the colors you want to mask not to be modified. The right mouse button unmasks this color. Hit “e” again to go finish.