开发者

How to quantize image color from RGB 24 bit to RGB 6 bit (64 colors)?

开发者 https://www.devze.com 2023-04-06 11:24 出处:网络
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百

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号