MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: reading pixels from a bmp file

  • To: mathgroup at
  • Subject: [mg20737] Re: [mg20625] reading pixels from a bmp file
  • From: Andrew Watson <abwatson at>
  • Date: Wed, 10 Nov 1999 00:17:49 -0500
  • References: <>
  • Sender: owner-wri-mathgroup at

At 2:13 AM -0500 11/4/99, Jesper Bannebjerg wrote:
>I have a problem with getting Mathematica to read a bitmap pixel by
>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 ????


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.

Andrew Watson

  • Prev by Date: Re: ContourPlot3D
  • Next by Date: Re: Re: hexagon tiled torus
  • Previous by thread: reading pixels from a bmp file
  • Next by thread: RasterArray doesn't work