I have a array containing data. This array contains only image data/ or it can be just random data. No header information is available. So writing this to a file and making its extension as jpg is not going to work. Can someone please recommend a library that would do this for me.
Any language that isnt a scripting language is ok. Any environment. I would prefer if its in C/Java/Matlab.
preguntado el 08 de noviembre de 11 a las 12:11
If you have your array in MATLAB (let's say it's in a variable called
im), then you can just type
imwrite(im, 'myfilename.bmp', 'bmp')
and your array will be written to a .bmp file. You can choose from a number of other common formats too. See the documentación para
You can even write random data in this way:
a = rand(100,100); imwrite(a,'testimg.jpg','.jpg')