I am building a display of sorts that opens and closes an array of solenoids to create bubbles under water. I need the arduino to be able to read image files to be able to display it. I can come up with a simple custom format for it, but I would prefer a standard format that can be saved from a program like photoshop. The images will be simple black and white. What is a good format for reading from arduino?
Bubble display concept:
I need the arduino to be able to read image files to be able to display it.
Read them from where?
I can come up with a simple custom format for it, but I would prefer a standard format that can be saved from a program like photoshop.
jpeg is out, then, as it is a compressed format, and the Arduino hasn't near enough memory to decompress a jpeg file. Any other compressed format is out for the same reason. bmp is the only format I can think of that you would stand a chance of reading.
Is there something after
Bubble display concept:
? If there is, I can't see it.
You would probably want imagemagick to convert to ascii/text for you… Probably difficult enough, as Paul said, use one without compression.
dxw00d - youtube http://www.youtube.com/watch?v=-cOnD74Gsug
Where its coming from hasnt been determined yet, but it doesn't seem like it matters. If it does, lets say an SD card.
After the text "Bubble Concept" is a youtube video
Strange. I can normally see youtube.
What format to choose will depend on the final output required. How many solenoids? Are they On/Off, or variable size bubbles?
At least Gimp can convert graphic files directly to C headers. For the image format what you are after is basically the same issue I have with my POV programs. Here is how I solved it: http://blog.blinkenlight.net/experiments/basic-effects/pov-generator/.
I only need on and off indicators, so the image needs to be 2 color black and white. I want photoshop to be able to generate the images so that our designers or marketing people can create the images themselves without needing to use a special program to convert the images
So you need files that end up looking like this?
With 1 - bubble on, 0 = bubble off (or vice versa)
Maybe try a search for "ascii art"
It looks like GIF might be doable if one could work out the LZW decoding
.Raw format looks like what I will be going with.
Take BMP format as it is uncompressed and well documented. For the bubbles you must create a black white image from the original image which can be done by dithering algorithms which can be found in many gaphics apps. BMP is typically not compressed so directly interpretable by an Arduino, no need to LZW decompress/deflate etc.
I would use gimp.
gimp can save the images in X bitmap or XBM format which is basically a C data structure
of the black/white pixels. Black pixels are 1 bits.
It can be readily compiled into your code.
There is plenty of documentation on the format.
By adding a PROGMEM declaration to the array,
you can make the data structure live in progmem.
The XBM format is also likely to be in the byte and bit order that you would need for
you bubble solenoids as well.
The pixel order of the XBM images is left to right and top to bottom
Pixels within each byte is msb to lsb within the bytes
You should be able to pull bytes from the data array and then go msb to lsb in each
byte and left to right with your solenoids for each row of pixels in the image data.
Gimp can directly generate C source / header files.
From the gimp output files I’ve been able to create, I found XBM format is easier to deal with
for monochrome pixels than the .h or .c files generated by gimp.
The .xbm file format is a C data array that is directly compilable similar to the
.c file output from gimp.
I prefer the .c format over the xbm format as it includes the sizing information in the data array
but I’ve not been able to get gimp to generate a .c file with anything but RGB data
so the xbm files are a smaller amount of data.
(Udo, do you know if there Is a plugin to provide monochrome .c data arrays ?)
Unfortunately not. This is the reason why I use a small python program. Since GIMP can be scripted it should not be to hard to create such a plugin. However I never found the timp to dig through all the documentation to create such a thing.
It is a bummer on the RGB format for .c files
but it still could be used even for monochrome pixel data if the images were not too large
to create a flash shortage.
For the glcd library,
I ended up using .xbm format and then manually copied the width and height into the data array
It wasn't that bad as the data declaration had to have PROGMEM added anyway.
Guess I should look into what it would take to create a custom gimp plug in with some options
for this kind of stuff.
i am working on an application that requires an image so i have interfaced ov7670 camera with arduino mega. i am getting image data from the camera in bayer raw rgb format, currently i am just checking the data by serially printing it on serial monitor. i have to save it into some file and use some python library to convert it into viewable format.
can anyone help me that how to save that data into a file with .raw extension , is it the correct extension for the raw bayer rgb ? if not in which extension it should be saved and how?