06-12-2020, 03:20 PM
Hello,
I'm currently learning programming in python, one of subject that i'm trying to cover now is working with image. So i wanted to created o program that's counting how many pixel of each colour is in my image (which is 10x10 pixel gray scale). So i created the image all black with 24 white pixel and my program, all works well. It counts 24 pixel of "255" and 76 of "0.
But here comes the problem:
when i have used the Gimp [color] -> [information] -> [export histogram] to file i got the results like this
Range start,Value
0 , 76.0
1 , 0.0
2 , 0.0
[...]
253 , 0.0
254 , 24.0
255 , 24.0
it looks like, the Gimp software counted white pixel two times, so when they are summed up that makes 24 + 24 + 76 = 124 , and yet the picture size is still 10x10 = 100
i've searched the internet but cant find the clue:
How it is possible that Gimp while exporting histogram counts more pixels than there are really in the picture?
Thank you for help
I'm currently learning programming in python, one of subject that i'm trying to cover now is working with image. So i wanted to created o program that's counting how many pixel of each colour is in my image (which is 10x10 pixel gray scale). So i created the image all black with 24 white pixel and my program, all works well. It counts 24 pixel of "255" and 76 of "0.
But here comes the problem:
when i have used the Gimp [color] -> [information] -> [export histogram] to file i got the results like this
Range start,Value
0 , 76.0
1 , 0.0
2 , 0.0
[...]
253 , 0.0
254 , 24.0
255 , 24.0
it looks like, the Gimp software counted white pixel two times, so when they are summed up that makes 24 + 24 + 76 = 124 , and yet the picture size is still 10x10 = 100
i've searched the internet but cant find the clue:
How it is possible that Gimp while exporting histogram counts more pixels than there are really in the picture?
Thank you for help