top of page

ALL POSTS:

Average (mean) colour of an image

I am interested in processing data from images, but so far I have only written code that performs posterisation on a greyscale image, the easiest way I thought of approaching this is to find the average colour of an image. This may even be too simple but I thought that writing this up would be a good idea because the most simple, but first steps are normally the hardest to take.


Basically all this code does is to add up all the red values, all the blue values and all the green values and then divide that by the total number of pixels, therefore giving you an average RGB value.


As you can see below I used Pillow in python.


Have a nice day :)

0 comments

Recent Posts

See All

A* path finding algorithm

This is another algorithm in python that I wrote from watching a Coding Train video! I really would recommend watching The Coding Train...

Comments


bottom of page