im2java2d

Convert image to Java buffered image

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.

Examples

Input Arguments

collapse all

Input image, specified as

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

  • m-by-n-by-3 matrix 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 BufferedImageclass 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).

Introduced before R2006a