Background & Context

    • 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 & Export

  • Import["file","RawBitmap",ImageSize->{w,h}] imports a raw bitmap file and returns an Image object.
  • The image size must be specified when importing a raw bitmap.
  • Import["file",{"RawBitmap",elem},ImageSize->{w,h}] imports the specified element from a "RawBitmap" file.
  • Export["file",expr,"RawBitmap"] exports graphics or any other expression as an image to a raw bitmap.
  • Raw bitmaps are created 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.
  • See the following reference pages for full general information:
  • Import, Exportimport from or export to a file
    CloudImport, CloudExportimport from or export to a cloud object
    ImportString, ExportStringimport from or export to a string
    ImportByteArray, ExportByteArrayimport from or export to a byte array

Import Elements

  • General Import elements:
  • "Elements" list of elements and options available in this file
    "Summary"summary of the file
    "Rules"list of rules for all available elements
  • Data representation elements:
  • "Data"array of color values
    "Graphics"Graphics object representing an image
    "Image"raster image, given as an Image object
  • Import and Export by default use the "Image" element for raw bitmap files.
  • Advanced Import elements:
  • "BitDepth"bits used to represent each color channel in the file
    "Channels"the number of color channels used in the file
    "ColorSpace"color encoding used in the file
    "Summary"summary of the file



Basic Examples  (2)

Read raw bitmap data, specifying the width and height of the image in pixels:

Summary of an image: