On Sat, Jan 8, 2011 at 10:22 AM, Venkatraman S <venka...@gmail.com> wrote:
> On Sat, Jan 8, 2011 at 10:19 AM, Narendra Sisodiya < > naren...@narendrasisodiya.com> wrote: > > > > > I am sorry but your code snippet was less efficient then what i posted > > initially. moreover, I was having black and white image. > > > > I thought you needed BW image. (I should read properly!!) > Also, can you expatiate on how it was less efficient - i would love to > learn. > Yes, I need black and white image, and I was having a grayscale image, I have posted initially this thing. you posted a RBG to black and white algorithm - even if somebody has RBG , why one should use at RBG level, the right way is to do is to convert to grayscale using avalable method. Also, you are using n = image.getpixel((i,j)) if n[0] < 127: #R value Which is totally wrong, you are using usiing R value, Any image which has lower R value or just haivng B and G component will be converted into fully black image. you should average or just L = xR+yB+zG method to get a average grayscale value of that pixel. {mainly intensity} Also, I too wrote pixel by pixel method which is expensive and I wanted to know better predefined algorithm. which i got. point method -- ┌─────────────────────────┐ │ Narendra Sisodiya │ http://narendrasisodiya.com └─────────────────────────┘ _______________________________________________ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers