• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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: 79969
396
  • 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
 
He's giving us the slip! Quick! Grab this tiny ad!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic