本文共 1076 字,大约阅读时间需要 3 分钟。
IMAGEMAGICK
// Display a 800x600 rgb image
display -size 800x600 -depth 8 rgb:output.rgb// Show information of output.rgb
identify -size 1296x972 -depth 8 output.rgb// Convert a 640x480 grayscale raw rgb file to png
convert -size 640x480 -depth 8 imagefile.rgb image.png// To list all available color formats
identify -list formatFFMPEG
// List available formats for ffmpeg
ffmpeg -pix_fmts// Convert raw rgb565 image to png
ffmpeg -vcodec rawvideo -f rawvideo -pix_fmt rgb565 -s 1024x768 -i freescale_1024x768.raw -f image2 -vcodec png screen.png// Convert png to raw rgb565
ffmpeg -vcodec png -i image.png -vcodec rawvideo -f rawvideo -pix_fmt rgb565 image.raw// Convert a 720x480 NV12 (YUV 420 semi-planar) image to png
ffmpeg -s 720x480 -pix_fmt nv12 -i image-nv12.yuv -f image2 -pix_fmt rgb24 image-png.png// Convert a 640x480 uyvy422 image to png
ffmpeg -s 640x480 -pix_fmt uyvy422 -i image-uyvy422.yuv -f image2 -pix_fmt rgb24 image-uyvy422.png
RGB raw数据显示GIMP软件可以显示RGB数据,文件->打开 选择 raw image data
然后指定图像大小 rgb格式就可以正常显示.
另外,GIMP中还能将rgb图像数据导出成.c或者.h文件,可以在C程序里面使用.
转载地址:http://ewhji.baihongyu.com/