• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

reading an image file

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi guys! I'm planning to use java for the implementation of my research. In my program i need to read and render an image file pixel by pixel and i want to be able to manipulate every pixel, is this possible? how?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

If the image is a GIF, JPEG, BMP or PNG then you can use the javax.imageio.ImageIO class to read and write it. (TIFF and some others are also possible after installing an extra library). That class will hand you a java.awt.image.BufferedImage object, from which you can obtain a WriteableRaster object through which pixels can be manipulated.
 
Rey Fernandez
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:Welcome to JavaRanch.

If the image is a GIF, JPEG, BMP or PNG then you can use the javax.imageio.ImageIO class to read and write it. (TIFF and some others are also possible after installing an extra library). That class will hand you a java.awt.image.BufferedImage object, from which you can obtain a WriteableRaster object through which pixels can be manipulated.



thank you.... what if i want to write my own image file format? i mean after reading a BMP, do some manipulation and then write it to a new file format my own image file format....
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rey Fernandez wrote:

Ulf Dittmer wrote:Welcome to JavaRanch.

If the image is a GIF, JPEG, BMP or PNG then you can use the javax.imageio.ImageIO class to read and write it. (TIFF and some others are also possible after installing an extra library). That class will hand you a java.awt.image.BufferedImage object, from which you can obtain a WriteableRaster object through which pixels can be manipulated.



thank you.... what if i want to write my own image file format? i mean after reading a BMP, do some manipulation and then write it to a new file format my own image file format....



Would like us to just do your research project for you? ;) Take a look at the APIs Ulf suggested. It helps to ask more specific questions and less about things you can do a bit of research to find out for yourself.
 
Rey Fernandez
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you I appreciated your offer but i really want to do it myself it's a part of the chellenge to do it myself.......
 
Marshal
Posts: 80940
521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And welcome to JavaRanch, Rey Fernandez
 
reply
    Bookmark Topic Watch Topic
  • New Topic