•Java Image To Graphics

Pixels in the Java image can be retrieved by using java.awt.image.PixelGrabber. A pixel in Java is defined by 4 byte integer in the form of ARGB. GrabPixels[ ] decompose the Java image into a matrix of {R,G,B}s.

In[11]:=

pixels = GrabPixels[javaImage, 0, 0, width/8, height/8] ;

In[12]:=

Dimensions[pixels]

In[13]:=

pixels[[1, 1]]

Matrix of colors GrabPixels[ ] has returned can be shown as Graphics object by converting it into a RasterArray[ ].

In[14]:=

g = ShowJavaImage[javaImage, width/4, height/4, width/4, height/4]

In[15]:=

g[[1]] // Head


Converted by Mathematica  (July 17, 2003)