public interface Image
Image is a container of an image in DJL. The storage type of the image depends on the
platform you are running on.| Modifier and Type | Interface and Description |
|---|---|
static class |
Image.Flag
Flag indicates the color channel options for images.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getHeight()
Gets the height of the image.
|
int |
getWidth()
Gets the width of the image.
|
java.lang.Object |
getWrappedImage()
Gets the wrapped image.
|
void |
save(java.io.OutputStream os,
java.lang.String type)
Save the image to file.
|
default NDArray |
toNDArray(NDManager manager)
Converts image to a RGB
NDArray. |
NDArray |
toNDArray(NDManager manager,
Image.Flag flag)
Converts image to a
NDArray. |
int getWidth()
int getHeight()
java.lang.Object getWrappedImage()
NDArray toNDArray(NDManager manager, Image.Flag flag)
NDArray.void save(java.io.OutputStream os,
java.lang.String type)
throws java.io.IOException
os - OutputStream to save the image.type - type of the image, such as "png", "jpeg"java.io.IOException - image cannot be saved through output stream