如何将图像的像素颜色信息转换为数字并将其存储在CSV中? [英] How can I convert an image's pixel color information into numbers and store it in a CSV?

查看:736
本文介绍了如何将图像的像素颜色信息转换为数字并将其存储在CSV中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将图像中的像素颜色信息提取为数字并将其存储在CSV文件中?这些数字应该分为1行和多列。如果图像是50 * 50,则应该只有1行和2500列包含像素颜色信息。我怎样才能在Python中实现这一目标?请建议。

How do I extract the pixel color information in an image into numbers and store them in a CSV file? These numbers should all go into 1 row and multiple columns. If the image is 50*50 then there should be only 1 row and 2500 columns containing the pixel color information. How can I achieve this in Python? Please advice.

推荐答案

它在很大程度上取决于图像的类型,因为bmp,jpeg,tiff等的内容都有自己的结构。所以你需要做的第一件事是研究可用于python的各种图像处理库,它们可以处理不同的类型。
It largely depends on the type of image, since the content of bmp, jpeg, tiff etc each has its own structure. So the first thing you need to do is research the various image handling libraries available for python which can handle the different types.


这篇关于如何将图像的像素颜色信息转换为数字并将其存储在CSV中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆