PHP可以读取图像文件吗? [英] Can PHP read an image file?
问题描述
在Windows上运行Apache2和PHP 4.3.3,有什么方法可以让我读取图像文件并输出其颜色内容吗?
最好,我想让它读取一个.bmp文件,并为图像的每个像素输出一个文本颜色代码的文件。
我可以如果需要,可以将它转换为.jpg或.gif格式,但我希望
如果可能的话继续使用.bmp。
任何帮助非常感谢。
-
兰迪
机会有利于准备好的心灵
Randy Webb写道:
在Windows上运行Apache2和PHP 4.3.3,有什么办法可以让PHP拥有PHP读取图像文件并输出其颜色内容?
我希望它能够读取.bmp文件并输出文本颜色代码的文件图片。
如果需要,我可以将它转换为.jpg或.gif,但如果可能的话,我宁愿继续使用.bmp。
非常感谢任何帮助。
是的,因为PHP摇滚! =)
PHP手册有很多信息。关于这个主题。
http://www.php.net/image
问候,
- Dan
http://www.dantripp.com/
" Randy Webb" <喜************ @ aol.com>在消息中写道
news:xu ******************** @ comcast.com ...正在运行Windows上的Apache2和PHP 4.3.3,有什么方法可以让PHP读取图像文件并输出其颜色内容吗?
我希望能阅读它一个.bmp文件,并为图像的每个像素输出颜色代码的文本文件。
如果需要,我可以将其转换为.jpg或.gif,但我更愿意<如果可能的话,请坚持使用.bmp。
非常感谢任何帮助。
-
兰迪
机会有利于准备好的思想
在这里,你打开一个jpg文件并逐个像素地吐出。
此刻,输出发送如果你愿意的话,你可以打开一个文件并将其转储
。
输出是逐行的,6 chr hex color
格式:
rrggbbrrggbbrrggbb
<?php
imgFile =" icon_ar.jpg" ;;
Running Apache2 and PHP 4.3.3 on Windows, is there any way that I can
have PHP read an image file and out put its color content?
Preferably, I would like for it to read a .bmp file and output a text
file of the color codes for each pixel of the image.
I can convert it to a .jpg or a .gif if need be, but I would prefer to
stay with the .bmp if its possible.
Any help is greatly appreciated.
--
Randy
Chance Favors The Prepared Mind
解决方案Randy Webb wrote:
Running Apache2 and PHP 4.3.3 on Windows, is there any way that I can
have PHP read an image file and out put its color content?
Preferably, I would like for it to read a .bmp file and output a text
file of the color codes for each pixel of the image.
I can convert it to a .jpg or a .gif if need be, but I would prefer to
stay with the .bmp if its possible.
Any help is greatly appreciated.
Yes, because PHP rocks! =)
The PHP manual has a bunch of info. on this topic.
http://www.php.net/image
Regards,
- Dan
http://www.dantripp.com/
"Randy Webb" <hi************@aol.com> wrote in message
news:xu********************@comcast.com...Running Apache2 and PHP 4.3.3 on Windows, is there any way that I can
have PHP read an image file and out put its color content?
Preferably, I would like for it to read a .bmp file and output a text
file of the color codes for each pixel of the image.
I can convert it to a .jpg or a .gif if need be, but I would prefer to
stay with the .bmp if its possible.
Any help is greatly appreciated.
--
Randy
Chance Favors The Prepared Mind
Here you go, this one opens up a jpg file and spits out pixel by pixel.
at the moment, the output is send to screen, you can open a file and dump it
there instead if you wish.
the output is row by row, and 6 chr hex color
format:
rrggbbrrggbbrrggbb
<?php
imgFile = "icon_ar.jpg";
这篇关于PHP可以读取图像文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!