Re: addendum Re: working with images (PIL ?)

2008-05-20 Thread Poppy
Thank you and the other responders have given me something to consider, I understand the concept of the posterize idea and will be experimenting with that. I wanted to respond to this statement below which is true, however I believe the histogram sums the values so both colors would be in bin 2

Re: addendum Re: working with images (PIL ?)

2008-05-20 Thread Ivan Illarionov
On Mon, 19 May 2008 10:18:00 -0400, Poppy wrote: > Thanks, since posting I figured out how to interpret the histogram > results, which seems to be the consensus in responses. I wrote a check > image program and have been periodically calling it against a folder > where I make a copy of our images

Re: addendum Re: working with images (PIL ?)

2008-05-19 Thread Ken Starks
I would still be concerned that you are checking against the percentage of the 768 bins returned by the histogram method. Two pixels of widely different colour end up in the same bin, so long as just ONE of the Red, Green, or Blue components is equal. So, for example, colours (2, 27, 200) and (20

Re: addendum Re: working with images (PIL ?)

2008-05-19 Thread Poppy
Thanks, since posting I figured out how to interpret the histogram results, which seems to be the consensus in responses. I wrote a check image program and have been periodically calling it against a folder where I make a copy of our images used for production. My method right now is to check w

Re: addendum Re: working with images (PIL ?)

2008-05-18 Thread Ken Starks
Oops. I meant: WhiteArea=Result.histogram()[255] of course, not WhiteArea=Result.histogram()[0] Ken Starks wrote: As others have said, PIL has the 'histogram' method to do most of the work. However, as histogram works on each band separately, you have a bit of preliminary programming first t

Re: addendum Re: working with images (PIL ?)

2008-05-17 Thread Ken Starks
As others have said, PIL has the 'histogram' method to do most of the work. However, as histogram works on each band separately, you have a bit of preliminary programming first to combine them. The ImageChops darker method is one easy-to-understand way (done twice), but there are lots of alterna

Re: addendum Re: working with images (PIL ?)

2008-05-16 Thread Ivan Illarionov
On Wed, 14 May 2008 14:35:25 -0400, Poppy wrote: > I've put together some code to demonstrate what my goal is though > looping pixel by pixel it's rather slow. > > import Image > > def check_whitespace(): > im = Image.open("server\\vol\\temp\\image.jpg") > > size = im.size > >

addendum Re: working with images (PIL ?)

2008-05-16 Thread Poppy
I've put together some code to demonstrate what my goal is though looping pixel by pixel it's rather slow. import Image def check_whitespace(): im = Image.open("server\\vol\\temp\\image.jpg") size = im.size i = 0 whitePixCount = 0 while i in range(size[1]): j =