| Package | Description | 
|---|---|
| java.awt.image | Provides classes for creating and modifying images. | 
| javax.imageio | The main package of the Java Image I/O API. | 
| Modifier and Type | Class and Description | 
|---|---|
| class  | BandedSampleModelThis class represents image data which is stored in a band interleaved
  fashion and for
  which each sample of a pixel occupies one data element of the DataBuffer. | 
| class  | ComponentSampleModelThis class represents image data which is stored such that each sample
  of a pixel occupies one data element of the DataBuffer. | 
| class  | MultiPixelPackedSampleModelThe  MultiPixelPackedSampleModelclass represents
 one-banded images and can pack multiple one-sample
 pixels into one data element. | 
| class  | PixelInterleavedSampleModelThis class represents image data which is stored in a pixel interleaved
  fashion and for
  which each sample of a pixel occupies one data element of the DataBuffer. | 
| class  | SinglePixelPackedSampleModelThis class represents pixel data packed such that the N samples which make
  up a single pixel are stored in a single data array element, and each data
  data array element holds samples for only one pixel. | 
| Modifier and Type | Field and Description | 
|---|---|
| protected SampleModel | Raster. sampleModelThe SampleModel that describes how pixels from this Raster
 are stored in the DataBuffer. | 
| Modifier and Type | Method and Description | 
|---|---|
| SampleModel | SinglePixelPackedSampleModel. createCompatibleSampleModel(int w,
                           int h)Creates a new SinglePixelPackedSampleModel with the specified
 width and height. | 
| SampleModel | PixelInterleavedSampleModel. createCompatibleSampleModel(int w,
                           int h)Creates a new PixelInterleavedSampleModel with the specified
 width and height. | 
| SampleModel | MultiPixelPackedSampleModel. createCompatibleSampleModel(int w,
                           int h)Creates a new  MultiPixelPackedSampleModelwith the
 specified width and height. | 
| SampleModel | ComponentColorModel. createCompatibleSampleModel(int w,
                           int h)Creates a  SampleModelwith the specified width and height,
 that  has a data layout compatible with thisColorModel. | 
| SampleModel | BandedSampleModel. createCompatibleSampleModel(int w,
                           int h)Creates a new BandedSampleModel with the specified
 width and height. | 
| SampleModel | ComponentSampleModel. createCompatibleSampleModel(int w,
                           int h)Creates a new  ComponentSampleModelwith the specified
 width and height. | 
| SampleModel | PackedColorModel. createCompatibleSampleModel(int w,
                           int h)Creates a  SampleModelwith the specified width and
 height that has a data layout compatible with thisColorModel. | 
| SampleModel | IndexColorModel. createCompatibleSampleModel(int w,
                           int h)Creates a  SampleModelwith the specified
 width and height that has a data layout compatible with
 thisColorModel. | 
| abstract SampleModel | SampleModel. createCompatibleSampleModel(int w,
                           int h)Creates a SampleModel which describes data in this SampleModel's
  format, but with a different width and height. | 
| SampleModel | ColorModel. createCompatibleSampleModel(int w,
                           int h)Creates a  SampleModelwith the specified width and
 height that has a data layout compatible with thisColorModel. | 
| SampleModel | SinglePixelPackedSampleModel. createSubsetSampleModel(int[] bands)This creates a new SinglePixelPackedSampleModel with a subset of the
 bands of this SinglePixelPackedSampleModel. | 
| SampleModel | PixelInterleavedSampleModel. createSubsetSampleModel(int[] bands)Creates a new PixelInterleavedSampleModel with a subset of the
 bands of this PixelInterleavedSampleModel. | 
| SampleModel | MultiPixelPackedSampleModel. createSubsetSampleModel(int[] bands)Creates a new  MultiPixelPackedSampleModelwith a
 subset of the bands of thisMultiPixelPackedSampleModel. | 
| SampleModel | BandedSampleModel. createSubsetSampleModel(int[] bands)Creates a new BandedSampleModel with a subset of the bands of this
 BandedSampleModel. | 
| SampleModel | ComponentSampleModel. createSubsetSampleModel(int[] bands)Creates a new ComponentSampleModel with a subset of the bands
 of this ComponentSampleModel. | 
| abstract SampleModel | SampleModel. createSubsetSampleModel(int[] bands)Creates a new SampleModel
 with a subset of the bands of this
 SampleModel. | 
| SampleModel | Raster. getSampleModel()Returns the SampleModel that describes the layout of the image data. | 
| SampleModel | RenderedImage. getSampleModel()Returns the SampleModel associated with this image. | 
| SampleModel | BufferedImage. getSampleModel()Returns the  SampleModelassociated with thisBufferedImage. | 
| Modifier and Type | Method and Description | 
|---|---|
| static Raster | Raster. createRaster(SampleModel sm,
            DataBuffer db,
            Point location)Creates a Raster with the specified SampleModel and DataBuffer. | 
| static WritableRaster | Raster. createWritableRaster(SampleModel sm,
                    DataBuffer db,
                    Point location)Creates a WritableRaster with the specified SampleModel and DataBuffer. | 
| static WritableRaster | Raster. createWritableRaster(SampleModel sm,
                    Point location)Creates a WritableRaster with the specified SampleModel. | 
| boolean | ComponentColorModel. isCompatibleSampleModel(SampleModel sm)Checks whether or not the specified  SampleModelis compatible with thisColorModel. | 
| boolean | PackedColorModel. isCompatibleSampleModel(SampleModel sm)Checks if the specified  SampleModelis compatible
 with thisColorModel. | 
| boolean | IndexColorModel. isCompatibleSampleModel(SampleModel sm)Checks if the specified  SampleModelis compatible
 with thisColorModel. | 
| boolean | ColorModel. isCompatibleSampleModel(SampleModel sm)Checks if the  SampleModelis compatible with thisColorModel. | 
| Constructor and Description | 
|---|
| Raster(SampleModel sampleModel,
      DataBuffer dataBuffer,
      Point origin)Constructs a Raster with the given SampleModel and DataBuffer. | 
| Raster(SampleModel sampleModel,
      DataBuffer dataBuffer,
      Rectangle aRegion,
      Point sampleModelTranslate,
      Raster parent)Constructs a Raster with the given SampleModel, DataBuffer, and
 parent. | 
| Raster(SampleModel sampleModel,
      Point origin)Constructs a Raster with the given SampleModel. | 
| WritableRaster(SampleModel sampleModel,
              DataBuffer dataBuffer,
              Point origin)Constructs a WritableRaster with the given SampleModel and DataBuffer. | 
| WritableRaster(SampleModel sampleModel,
              DataBuffer dataBuffer,
              Rectangle aRegion,
              Point sampleModelTranslate,
              WritableRaster parent)Constructs a WritableRaster with the given SampleModel, DataBuffer,
 and parent. | 
| WritableRaster(SampleModel sampleModel,
              Point origin)Constructs a WritableRaster with the given SampleModel. | 
| Modifier and Type | Field and Description | 
|---|---|
| protected SampleModel | ImageTypeSpecifier. sampleModelA  SampleModelto be used as a prototype. | 
| Modifier and Type | Method and Description | 
|---|---|
| SampleModel | ImageTypeSpecifier. getSampleModel()Returns a  SampleModelbased on the settings
 encapsulated within this object. | 
| SampleModel | ImageTypeSpecifier. getSampleModel(int width,
              int height)Returns a  SampleModelbased on the settings
 encapsulated within this object. | 
| Constructor and Description | 
|---|
| ImageTypeSpecifier(ColorModel colorModel,
                  SampleModel sampleModel)Constructs an  ImageTypeSpecifierdirectly
 from aColorModeland aSampleModel. | 
 Submit a bug or feature 
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2025, Oracle and/or its affiliates.  All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.