Clicky

I'm working with an embedded system and a simple LCD display.  The programming API for putting images on the LCD wants ultra simple data.  It is expecting each pixel of the 240 x 320 screen to be defined using a 16 bit number (565 color mode) starting at the top left and going from left to right for each row and top to bottom of the screen..
I don't want any file header info, just raw 16 bit data for each pixel.
Is there already a raw image format out there setup in this manner?
If not, any suggestions?  Is it possible to simply delete the header off a 16 bit TIFF and it will leave the data the way I want?
Many thanks.

asked 11/24/2011 12:39

JohnSantaFe's gravatar image

JohnSantaFe ♦♦


9 Answers:
None that I know of.
You could use the SDL library on a desktop linux pc to load a standard image (PNG or JPEG for example) using the sdl_image library, load it on a SDL_surface and save the SDL_surface (after translating it to the right pixel format) on a raw binary file. Then load the binary file in the target device.
Pay attention that each image requires about 156k on ram, and if you have many images you could run out of storage or ram on the target board. In this case, have the original compressed picture on the target board and translate it for the framebuffer pixel format using the same procedure.

Hope that helps.
link

answered

HappyCactus's gravatar image

HappyCactus

I'd say, you described the standard BMP-format. You can put all images on one big image. Then, the app may copy a needed part of this big image to the device context.
http://www.fileformat.info/format/bmp/egff.htm
link

answered 2011-11-25 at 01:56:10

pgnatyuk's gravatar image

pgnatyuk

No, BMP is only 24bit format, with padding.
link

answered 2011-11-25 at 06:32:39

HappyCactus's gravatar image

HappyCactus

No. BMP can be BW, can be RGB565, ARGB 32, etc. I mean the graphics format.
link

answered 2011-11-25 at 06:37:09

pgnatyuk's gravatar image

pgnatyuk

BMP can do arbitrary bit arrangement with the bitfields flag in its header.  However it could be difficult to control whether any program save to RGB565 or RGB555.  You might try saving from Photoshop without an alpha channel and see what format it uses.  TGA's 16 bit mode is  RGBA5551 so that's no use.

DDS can do RGB565.  The file format has chunks, so it's a little bit more complex than a flat file with a header and image data.  Though its not something that should cause any particular trouble and the image data is not compressed.  You can get DDS exporters for Photoshop and GIMP, there is also a DDS Tool that comes with the DirectX SDK.

You can use the RAW file import in Photoshop to load image files that don't have a header.  You can also use RAW to check the image data format.  Tell it to skip the header bytes, and what width and bit format you are expecting and see if the image looks OK.  There is a RAW plugin for GIMP also.
link

answered 2011-11-26 at 00:14:11

satsumo's gravatar image

satsumo

Thanks all.
I have the image already and I want to get to the 16 (565) format.  It looks like Photoshop will save as a raw image, unfortunately it's 24 bit and I didn't see an option to change it.  At least it doesn't have header info or compression so it's probably just a matter of converting from  24 bit to 16 bit.
I'll take a look at the raw plugin for gimp next.
link

answered 2011-11-26 at 06:05:56

JohnSantaFe's gravatar image

JohnSantaFe

You might want to just bite the bullet and convert it yourself.  Save it into a very simple, BMP or TGA, RGB888 format.  Load the the simple file, find the image bits, convert them to RGB565 and save them to a file.  That may turn out to be less time consuming than trying to find a combination of tools that will do the job.

Another option is ImageMagick.  A command line tool that allows loading, converting and saving in specific formats. http://www.imagemagick.org/script/index.php
link

answered 2011-11-27 at 08:33:51

satsumo's gravatar image

satsumo

In Adobe Photoshop when you press "Save As..." should be "R5 G6 B5" in the Advanced Mode.
I think, there is another simple option: Paint.NET - it's free and supports many graphics formats including RGB565:
http://paint.net.amihotornot.com.au/Features/Effects/Plugins/File_Types/
  • 565.jpg
    • 36 KB

    Adobe. Advanced Mode

link

answered 2011-11-27 at 14:54:36

pgnatyuk's gravatar image

pgnatyuk

I don't have the advanced mode in my version of Photoshop, but Paint.NET rocks!!  With their plugin it creates the file format I need.
Thanks.
link

answered 2011-11-27 at 23:28:04

JohnSantaFe's gravatar image

JohnSantaFe

Your answer
[hide preview]

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×1
×2

Asked: 11/24/2011 12:39

Seen: 230 times

Last updated: 11/29/2011 12:10