Re: reading pixels from a bmp file
- To: mathgroup at smc.vnet.net
- Subject: [mg20737] Re: [mg20625] reading pixels from a bmp file
- From: Andrew Watson <abwatson at mail.arc.nasa.gov>
- Date: Wed, 10 Nov 1999 00:17:49 -0500
- References: <199911040713.CAA02692@smc.vnet.net.>
- Sender: owner-wri-mathgroup at wolfram.com
At 2:13 AM -0500 11/4/99, Jesper Bannebjerg wrote: >Hello > >I have a problem with getting Mathematica to read a bitmap pixel by >pixel. >I want to load an image from a bmp file and then read each line and >each pixel. >How do i do that. >I can easely get Mathematica to show the graphic image but i cant get >it to read the elements (the pixels) >Any ideas ???? Try: ReadImage[filename_, format_] := Import[filename, format][[1, 1]] If your file is "file.bmp", then image = ReadImage["file.bmp", "BMP"] ; The result will be an array of numbers. Regards, Andrew Watson
- References:
- reading pixels from a bmp file
- From: jesper.bannebjerg@get2net.dk (Jesper Bannebjerg)
- reading pixels from a bmp file