GIMP, standing for GNU Image Manipulation Program, offers a complete open-source code, all while making itself available for Linux, macOS, and Windows for free.
Support for layers, layer masks, inverting masks, blend modes, brushes, pixel selection, changing saturation, hue, brightness, and so much more are all available.