This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
Mathematica Import/Export Format

RawBitmap

Raw raster image data.    
Used as an intermediate format by imaging devices.
Stores images as RGB or grayscale bitmaps at a resolution of 8 bits per channel.
Binary format.
Does not include meta-information.
Equivalent to the binary portion of PPM files.
  • Import["file", "RawBitmap", ImageSize -> {w, h}] imports a raw bitmap file, returning a graphics object.
  • The image size must be specified when importing a raw bitmap.
  • Export["file", expr, "RawBitmap"] exports graphics or any other expression as an image to a raw bitmap.
  • Import["file", "RawBitmap", ImageSize -> {w, h}]returns an expression of the form Graphics[Raster[data], opts], where data is an array of RGB color values.
  • Export["file", expr, "RawBitmap"] creates a raw bitmap with the same image size as the displayed form of expr.
  • All fonts are rasterized on export.
  • The format name "RawBitmap" must be explicitly specified.
  • Import["file", {"RawBitmap", elem}, ImageSize->{w, h}] imports the specified element from a "RawBitmap" file.
  • Import["file", {"RawBitmap", elem, suba, subb, ...}, ImageSize->{w, h}] imports a subelement.
  • Import["file", {"RawBitmap", {elem1, elem2, ...}}, ImageSize->{w, h}] imports multiple elements.
  • Export["file", expr, {"RawBitmap", elem}] creates a raw bitmap file by treating expr as specifying element elem.
  • Export["file", {expr1, expr2, ...}, {"RawBitmap", {elem1, elem2, ...}}] treats each expri as specifying the corresponding elemi.
  • Export["file", expr, "RawBitmap", opt1->val1, ...] exports expr with the specified option elements taken to have the specified values.
  • Export["file", {elem1->expr1, elem2->expr2, ...}, {"RawBitmap", "Rules"}] uses rules to specify the elements to be exported.
  • See the reference pages for full general information on Import and Export.
"Elements" list of elements and options available in this file
"Rules"full list of rules for each element and option
"Options"list of rules for options, properties, and settings
  • Data representation elements:
"Data"array of color values
"Graphics"Graphics object representing an image
"GrayLevels"array of normalized gray-level values
"RGBColorArray"array of RGBColor objects
  • Import and Export by default use the "Graphics" element for "RawBitmap" files.
"BitDepth"bits used to represent each color channel in the file
"ColorSpace"color encoding used in the file
  • General options:
ImageSizeAutomaticoverall image size, always specified on Import
Read raw bitmap data, specifying the width and height of the image in pixels:
In[1]:=
Click for copyable input
Out[1]=