Bitmap Image Output in C -


i'm working on small project in c , @ 1 point, need write picture content of array file. have run on embedded system @ point, additional libraries not option.

the code have far works (in modified version) rgb, fails 8bit grayscale.

this stripped down version of code far: http://pastebin.com/u1uyaput

as suspect header broken in way, question comes down to: correct header bmp file 8bit grayscale?

your code a lot simpler if ditched bmp , wrote images pgm files instead. format lot more portable , easy work in code. both formats uncompressed data rates same. thing lose ability view images natively on windows systems -- whether or not big deal depends on requirements.

here examples.

edit

at least, if write images in pgm and broken bmp, can use imagemagick reliably convert pgm working bmp. compare headers of working , broken bmp images using binary diff tool , fix bmp writer, if required.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -