python的matplotlib模块实现图片位深的转化
import matplotlib.image as mpimgfrom PIL import Imagedef bit_depth_convert(): img_path = r'图片位置' img = mpimg.imread(img_path) print('img_shape', img.shape) """ 获取位深 im = Image.open(img_path) print(im.getbands()) """
原创
2024-02-19 17:58:21 ·
417 阅读 ·
0 评论