Getting list of pixel values from PIL

前端 未结 9 1134
感动是毒
感动是毒 2020-11-27 15:07

Guys, I\'m looking for a bit of assistance. I\'m a newbie programmer and one of the problems I\'m having at the minute is trying to convert a black & white .jpg

9条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-27 15:42

    If you have numpy installed you can try:

    data = numpy.asarray(im)
    

    (I say "try" here, because it's unclear why getdata() isn't working for you, and I don't know whether asarray uses getdata, but it's worth a test.)

提交回复
热议问题