Image programming
Hi everyone, this may be a stupid question, but here goes:
Is it possible to gather/change data from an image in Java? Where would I begin to look into this?
I'd like to create a function that could do 2d per-pixel transparency collision. So if I have a .gif of a circle with the outside being transparent, could I make a function that would collide only with the circle, rather than using coordinates.
I'm sorry if my question isn't clear.
Thanks in advance.
I never tried anything similar, but I think I may have an idea.
You see, every file format, including JPG, GIF, BMP, etc., has a specific file format. If you know the file format, you can select the parts, the specific bytes, that you're interested in and manipulate it however you would like.
Sites such as these may be of help for GIF files, for example:
http://ptolemy.eecs.berkeley.edu/eecs20/sidebars/images/gif.html
http://schmidt.devlib.org/file-formats/gif-image-file-format.html
Or, more generally, you can google something like GIF image format, or whatever file format you are interested in.
Basically, once you open the file (probably in binary mode), it's a matter of pulling out the right bytes and knowing what to do with them.
You see, every file format, including JPG, GIF, BMP, etc., has a specific file format. If you know the file format, you can select the parts, the specific bytes, that you're interested in and manipulate it however you would like.
Sites such as these may be of help for GIF files, for example:
Or, more generally, you can google something like GIF image format, or whatever file format you are interested in.
Basically, once you open the file (probably in binary mode), it's a matter of pulling out the right bytes and knowing what to do with them.
java library for manipulating images. last i've seen there were alot of tutorials on it on the web too
http://java.sun.com/products/java-media/jai/
http://java.sun.com/products/java-media/jai/
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement