This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pixels and Pictures

 
Lora Tully
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody. Great to be here! Everyone seems really nice in here and I hope I have nicer time here then other forums I been too hehe Anyway onto my program. I am just a casual Java programmer, sad I know hehe and I havent done anything like this in school or anything but as a keen programmer its fun to try new languages. I was playing around with Java and I thought I would mess about with pictures and images. Now I created a few black and white images in JPEG format. I was hoping to makes a silly little program that would count how many black pixels and how many white pixels but found this to be quite harder then I thought it would be. I heard of using the pixel grabber or something but I dont really know how to get started. Can anyone help me please? Thank you!

All the best
Lora
xxx
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you looked at java.awt.Image yet? If not, that would probably be a good place to start. java.awt.image.PixelGrabber might also be helpful.

These links are part of the Java API documentation. You should familiarize yourself with these docs and learn how to navigate them. They are a great tool to find the methods that you need, or to remind yourself what parameters and return types are used by a particular method that you are already familiar with. Note that the Java API docs are not a tutorial, though. Still, they are handy for reference. If you want tutorials to get you started on particular subjects, Sun (the makers of Java) provide some here. There are also other available online resources, too, but I'll let you google for those.

Keep coding!

Layne
 
Bob Frapples
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Search for uses of BufferedImage. Lost of code/examples out there. Used for low-level image manipulation. Might check out VolitileImage as well, as it's newer and makes use of hardware acceleration.
 
Basanth P Rangadhol
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeh.. Layne is wright.. if your not familiar with image classes.. then better to go thru.. also.. in 1.4 there is awhole set of package..
javax.ImageIo.. which has an ImageIO class which takes care of reading and writing image file.. and i have not gone thru the "plugin" classes.. to decompress "*.jpg" files...


still lot more....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic