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

Pixels and Pictures

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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....
reply
    Bookmark Topic Watch Topic
  • New Topic