• Post Reply Bookmark Topic Watch Topic
  • New Topic

Converting image to 3D int array

 
D diller
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to load an image and convert it to a 3D int array like array[z][x][y] where z corresponds to the red, blue, or green value of the image, x refers to the row of a pixel, and y refers to the column of a pixel. I then want to be able to add various filters (sharpen, etc) to the array and redisplay the image - I'm not worried about that right now though.

I've been searching for the past week on how to convert an image to a 3D array, but I have come up empty handed. Any tips would be greatly appreciated.
 
Rob Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at javax.imageio.ImageIO combined with java.awt.image.BufferedImage.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
... and once you have a BufferedImage, you can get at the image's data in the form of a java.awt.image.Raster object, which makes the pixel data available in various forms.
 
Campbell Ritchie
Marshal
Posts: 52519
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like something which is usually discussed on the Swing forum. Moving.
 
Marky Vasconcellos
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So.. you really dont need convert to an 3D array for apply a filter in Image.

There's a brazilian project for applying filters in images.
Take a look:
http://incubadora.fapesp.br/sites/marvin/

if you cant understand portuguese you can download the source and study then:
http://incubadora.fapesp.br/frs/?group_id=686
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!