python使用PIL模块获取图片像素点的方法

作者:ABigCaiBird 时间:2022-07-28 10:57:57 

如下所示:


from PIL import Image
########获取图片指定像素点的像素
def getPngPix(pngPath = "aa.png",pixelX = 1,pixelY = 1):
    img_src = Image.open(pngPath)
    img_src = img_src.convert('RGBA')
    str_strlist = img_src.load()
    data = str_strlist[pixelX,pixelY]
    img_src.close()
    return data

print(getPngPix())

来源:https://blog.csdn.net/caobin0825/article/details/80338305

标签:python,PIL,图片,像素点
0
投稿

猜你喜欢

  • 960 Grid System 基本原理及使用方法

    2009-02-28 13:35:00
  • 使用 XMLSPY 设计项目的 Schema 原型

    2010-08-24 18:25:00
  • 20行python代码的入门级小游戏的详解

    2023-07-15 01:25:31
  • asp之日期和时间函数示例

    2008-04-13 06:50:00
  • asp实现在线人数统计代码

    2008-08-10 18:35:00
  • 如何使用python的ctypes调用医保中心的dll动态库下载医保中心的账单

    2022-08-02 13:14:35
  • mysql Load Data InFile 的用法

    2009-09-06 12:08:00
  • Python中常用操作字符串的函数与方法总结

    2023-07-25 12:09:23
  • 轻松解决SQL Server 2005中的常见问题

    2008-11-28 14:11:00
  • pytorch fine-tune 预训练的模型操作

    2023-05-02 01:05:25
  • ASP初学者学习ASP指令

    2008-10-14 17:27:00
  • nginx+uwsgi+django环境搭建的方法步骤

    2022-01-12 16:34:59
  • Python定时发送消息的脚本:每天跟你女朋友说晚安

    2023-05-26 02:47:14
  • python中字符串最常用的十三个处理操作记录

    2023-10-19 23:25:32
  • 使用Pytorch来拟合函数方式

    2021-06-22 18:10:45
  • 基于Python中单例模式的几种实现方式及优化详解

    2022-10-24 14:20:45
  • Python模块glob函数示例详解教程

    2023-10-27 15:49:36
  • 浅谈PHP中常用的3种设计模式

    2023-10-18 06:23:02
  • python中uuid模块实例浅析

    2022-06-16 01:01:24
  • Python如何查看并打印matplotlib中所有的colormap(cmap)类型

    2023-12-05 11:04:28
  • asp之家 网络编程 m.aspxhome.com