%% Convert Truecolor Image to Java Image Class
% Read a truecolor (RGB) image into the MATLAB™ workspace.

RGB = imread('ngc6543a.jpg'); 

% Use the im2java function to convert the truecolor image into an instance of the Java image class.

javaImage = im2java(RGB)

% Display the Java image.

frame = javax.swing.JFrame; 
icon = javax.swing.ImageIcon(javaImage); 
label = javax.swing.JLabel(icon); 
frame.getContentPane.add(label); 
frame.pack 
frame.show

%
% Copyright 2018 The MathWorks, Inc.