| | |
Can I make a Java Image Editing Photshop-like program
![]() |
Should be lots of resources on this. Check out the Java Tutorials http://java.sun.com/docs/books/tutorial/index.html and also the demos that you will have recieved in your sdk.
There are two features of Java that make it easy to do this kind of thing.
1. The API contains support for viewing many graphic types by default.
2. The Graphic Components in Java allow you to extract the displayed Graphics object, that you may then manipulate as you see fit and export to file.
Have fun.
There are two features of Java that make it easy to do this kind of thing.
1. The API contains support for viewing many graphic types by default.
2. The Graphic Components in Java allow you to extract the displayed Graphics object, that you may then manipulate as you see fit and export to file.
Have fun.
hi,
For drag and drop you can try java.awt.datatransfer API. For scaling the images try java.awt.Image method getScaledInstance(int width, int height, int hints) and other related api.
Hope this helps
Regards
Srinivas
For drag and drop you can try java.awt.datatransfer API. For scaling the images try java.awt.Image method getScaledInstance(int width, int height, int hints) and other related api.
Hope this helps
Regards
Srinivas
We come to love not by finding a perfect person, but by learning to see an imperfect person perfectly.
-Sam Keen, from To Love and Be Loved
-Sam Keen, from To Love and Be Loved
You need to access the pixels directly. Then you can do any thing you want with the image. To do this you use:
java.awt.image.PixelGrabber
Then it all gets down to doing the "math" on the pixels to do the effect you want.
Jeff
http://www.heatonresearch.com
java.awt.image.PixelGrabber
Then it all gets down to doing the "math" on the pixels to do the effect you want.
Jeff
http://www.heatonresearch.com
The math part is language independent.
There are books about image manipulation out there, many highly theoretical.
Lowpass and highpass filters work essentially the same as in electronics, so filter theory books for that should work as well.
Start out writing a simple filter, and work your way up
Essentially a basic filter takes a pixel and based on its value and a mathematical formula performs some operation on pixels surrounding it.
For example, a very simple filter indeed would just decrease that value by a set amount:
If you consider a pixel to be a single value (greyscale) for now, putting this matrix over a pixel would decrease (darken) all pixels surrounding it slightly.
That's the easiest example. Once you get something like this working, more complex filters are possible to do things like edge detection and working on larger areas.
But the math involved quickly gets rather complex. Now I don't mind complex math (it used to be a hobby of mine as well as part of my study) but I'm no expert at this and my knowledge is rather rusty.
There are books about image manipulation out there, many highly theoretical.
Lowpass and highpass filters work essentially the same as in electronics, so filter theory books for that should work as well.
Start out writing a simple filter, and work your way up

Essentially a basic filter takes a pixel and based on its value and a mathematical formula performs some operation on pixels surrounding it.
For example, a very simple filter indeed would just decrease that value by a set amount:
Java Syntax (Toggle Plain Text)
--------------- | -1 | -1 | -1 | | -1 | 0 | -1 | | -1 | -1 | -1 | ---------------
If you consider a pixel to be a single value (greyscale) for now, putting this matrix over a pixel would decrease (darken) all pixels surrounding it slightly.
That's the easiest example. Once you get something like this working, more complex filters are possible to do things like edge detection and working on larger areas.
But the math involved quickly gets rather complex. Now I don't mind complex math (it used to be a hobby of mine as well as part of my study) but I'm no expert at this and my knowledge is rather rusty.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
I don't know what to use to get the pixels (like I said, I've never done anything like this in Java, last time was C++ under DOS).
Best way would be to get access to the raw image data and manipulate that, would certainly be a lot faster.
You can apply filters to do pretty much anything. Where I put -1 for each, you could have any combination of values including mathematical functions, possibly different for each pixel.
Best way would be to get access to the raw image data and manipulate that, would certainly be a lot faster.
You can apply filters to do pretty much anything. Where I put -1 for each, you could have any combination of values including mathematical functions, possibly different for each pixel.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
![]() |
Other Threads in the Java Forum
- Previous Thread: Using a Java Object in a JSP
- Next Thread: Review my applet
| Thread Tools | Search this Thread |
account android applet application apps array automation awt bidirectional binary birt bluetooth businessintelligence busy_handler(null) card class classes client code collision columns component constructor database designadrawingapplicationusingjavajslider draw eclipse error eventlistener exception expand fractal free game givemetehcodez graphics gui guidancer homework html ide image inheritance integer integration intellij j2me java javafx javamicroeditionuseofmotionsensor javaprojects jlabel jme jni jpanel jtextfield jtree julia linux loop method midlethttpconnection migrate mobile mobiledevelopmentcreatejar monitoring myaggfun netbeans newbie nullpointerexception open-source oracle plazmic print problem program property ria scanner server set sharepoint smart sms smsspam sourcelabs splash sql sqlite subclass support swing testautomation textfield threads tree trolltech unlimited utility windows






