Useful tools to convert image format on PC

Document created by rogeriopimentel Employee on Apr 9, 2014Last modified by rogeriopimentel Employee on Apr 9, 2014
Version 1Show Document
  • View in full screen mode

When working with IPU applications, sometimes image format converter is needed to check images generated by IPU that are not readable by PC (e.g. RGB565, common i.MX framebuffer format -> png or jpg) or generate a RGB picture from an encoded file to be read by IPU (e.g. png -> RGB565 framebuffer).

There are some useful tools on Linux and some also available on Windows that can perform these conversions. I listed 5 tools with some usage examples below.

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 format

For more information about Imagemagick and its format support. access: http://www.imagemagick.org/script/formats.php

FFMPEG

// 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

MENCODER

http://www.mplayerhq.hu/DOCS/HTML/en/encoding-guide.html

TRANSCODING

http://www.transcoding.org/cgi-bin/transcode?Examples

GRAPHICSMAGICK

http://www.graphicsmagick.org/

Attachments

    Outcomes