BMP to ASCII

I need a routine to copy BMP images to ASCII text output, just the pixel values, that is, I don't want to decipher fonts, I have images containing no
text, and I need to read the pixel values into a VHDL simulator that only accepts ASCII format.
Thanks,
b r a d @ a i v i s i o n . c o m
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

no
There is no such thing as a 'BMP to ASCII' converter. but there may be a 'BMP to ASCII-art' conterver ! But that is not what you want.
....I don't know what VHDL SIMULATOR is, but you have some homework to do: What a FILE FORMAT is !
BMP is a fileformat made by MICROSOFT for raster images JPG is a fileformate made by COMPUSERVE for raster images DOC is fileformat made by MICROSOFT for text files .....and so on
A fileformat consits of two parts : a FILE-HEADER and a folowing DATA part .....
Thees two parts are joined into one long ASCII string and writen onto your hdd and becomes a file .... Later you may command a program to open this file , the program will analyse the first part of the file ( the file-header) and if it is a format it supports it will contiue read , otherwise stop !..........................
Fonts & text do not exist inside a BMP image/file , It's just raster pixels ( but the pixels may look like text ;o)
The BMP file format is old, and should be easy to understand , so that you can make a prog that opens BMP files - remove the BMP FILE HEADER and passes along the pixel values throug your ASCII databus (a file on the hdd) to the VDHL device (in a VDHL FORMAT ?)
reg A.P.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
An unencoded TXT file, which one could call ASCII, is also a byte binary file.
The O.P. just needs to do a search to find the file format.
http://www.dcs.ed.ac.uk/home/mxr/gfx/2d/BMP.txt
Mike

containing
only
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
The AVR edit distribution at http://www.avrfreaks.net/AVRGCC / includes a small "a small bitmap-to-array editor." It has worked good for me in the past. Matt Meerian
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Can you be more specific?

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
The program was used to take a bitmap and convert it into a "C" array of integers. The "C" array was then inserted into the code for an AVR microcontroller, which then put the bitmap on a 128x64 pixel graphical LCD.

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

I hope you are wrong.

That's right.

VHDL and Verilog are simulation languages.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

I think you will have to read aboat and understand the 'BMP-file-format'. http://www.fortunecity.com/skyscraper/windows/364/bmpffrmt.html This page explain the bmp-format . It shows you that all BMP files starts whit the two ascii-charcters : "BM" (Then all computer programs world-wide that is commaned to open this file will know that this file is 99% likely to be a BMP image.)
Then you can open BMP files , peal of the header part and present the ascii data's (for the color-channels you want) to your VHDL simulator in a way that makes sense .
BMP is a fileformat . Ascii is not a fileformat. Does VHDL have any picture/image fileformat ?
What shall VHDL do whit the BMP image : Display it on a screen ? Controll a milling tool ? Manipulate the image and save it (in a new fileformat)?
You could use a HexEditor and open a small and simple BMP file (make a small BMP picture [32x32pixels] whit white background and a small black square in the center ) Then you will get a clue of what your are up against :o)
reg A.P.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

The BMP file format has many sub-variants. The easiest to work with, and the most generally useful, is uncompressed 24bpp color bitmaps.
Make your square all black with a red pixel in one corner, a green pixel in another corner, a blue pixel in the third corner, and a white pixel in the fourth corner :)
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

As part of a machine vision experiment, I wrote subroutines to read and write BMP image files (24bpp only) into and out of 2D RAM arrays. Email me if you want this code (it's in C, and in fact constitutes a sneak preview of the book I finished a couple of months ago, so it's freely redistributable)
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.