Main Content

im2java2d

(To be removed) Convert image to Java buffered image

im2java2d will be removed in a future release. For more information, see Compatibility Considerations.

Description

javaImage = im2java2d(I) converts the input image to an instance of the Java image class java.awt.image.BufferedImage.

javaImage = im2java2d(X,map) converts an indexed image with colormap map to an instance of the Java image class java.awt.image.BufferedImage.

Input Arguments

collapse all

Input image, specified as

  • m-by-n matrix for grayscale and binary images.

  • m-by-n-by-3 array for RGB color images.

Data Types: double | uint8 | uint16 | logical

Input indexed image, specified as a m-by-n matrix.

Data Types: double | uint8 | uint16

Colormap associated with input indexed image X, specified as a c-by-3 numeric array. c represents the number of colors in the colormap.

Data Types: double

Output Arguments

collapse all

Output Java 2D image, returned as a BufferedImage class of instance java.awt.image.BufferedImage. The output Java 2D image can be used with the Java 2D API and the Java Abstract Windowing Toolkit (AWT).

Version History

Introduced before R2006a

collapse all

R2020a: im2java2d function will be removed

The im2java2d function will be removed in a future release. There is no replacement for this function.