This content is licensed under Creative Commons Attribution/Share-Alike License 3.0 (Unported). That means you may freely redistribute or modify this content under the same license conditions and must attribute the original author by placing a hyperlink from your site to this work https://planetcalc.com/9259/. Also, please do not modify any references to the original work (if any) contained in this content.
The calculator below loads an image and produces a negative image by inverting RGB colors of the loaded image. The RGB color model represents each color as a combination of three color channels: red, green, and blue. By default, the calculator inverts all three, however, you can choose the channels to be inverted. This allows you to produce, for example, only red or only green negative picture. The algorithm of inversion is described below the calculator.
Inverting an image
In the RBG model, each pixel of the image is represented by three numbers (R, G, B), each of them represents the model channel: R - for the red channel, G - for the green channel, B - for the blue channel. Each number lies in the range 0 - 255. This model is called an additive color model, since a particular color is produced by adding three primary colors to the black color (0, 0, 0). The maximum value - (255, 255, 255) represents a white color. The calculator above simply inverts all pixels of the image using the formula (255-R, 255-G, 255-B).