Member-only story

Inverting Images Using python.

Detailed guidance with source code.

Nishad Ahamed
Dev Genius
5 min readFeb 14, 2022

A glance at what the article is about.

There are plenty of libraries in python which offer a wide range of features and functionalities. In such a way, python has many libraries to play with images and do various alterations with few lines of code.

We have many libraries of python which give an inverted image directly using some inbuilt functions. This article will look into a method to understand the functionality behind the screens.

How images are stored

We can see that when we zoom into the images tends to get blurry, and we can see individual squares, which are known as pixels. Pixels are the basic blocks of the images that extend horizontally and vertically according to the image's dimensions, storing the required data about each block. Pixel Values are numbers that represent the numerical value of each of these pixels. These pixel values represent the intensity of the pixels. Pixel values for grayscale or black-and-white images range from 0 to 255. The smaller numbers closer to zero represent the darker shade, while the larger numbers closer to 255 represent the lighter or the white shade.

Published in Dev Genius

Coding, Tutorials, News, UX, UI and much more related to development

Written by Nishad Ahamed

Hi, I am Nishad Ahamed, an IT undergrad. I am passionate about web development, Data Science, and Artificial intelligence.

No responses yet

Write a response