I'm trying to deploy BIC algorithm (border/interior pixel classify) and using PIL (python imaging library) to process image . But i don't know how to quantize RGB color from 24bit (8b开发者_Python百科it per color) to 6 bit (2bit per color) by using PIL . Anyone can tell me how to do it by PIL or another python library such as Opencv , pythonmagick...?
the PIL ImageOps posterize (scroll down to posterize) function should do this for you.
精彩评论