File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes jpeg problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "jpeg problems" Watch "jpeg problems" New topic
Author

jpeg problems

colton peterson
Ranch Hand

Joined: Nov 18, 2007
Posts: 97

I am trying to make a very simple program that is like a coloring book. It takes a black and white outline of a picture from a jpeg and lets the user fill of the spaces with color like a coloring book. I don't know any practical way to do this. My original idea was to put it on a bufferedimage and edit pixel by pixel but this was to hard on the computer I am using. Any help would be appriciated


www.mormon.org
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
It sounds like the first step would be to create the outline from the image. I think you'd need a line-detection algorithm for that. If this is a color picture it might produce additional spurious lines where there aren't really any. Do you have experience with this kind of image processing?

The second part (letting the user fill the outline) sounds easier. If you search for "flood-fill algorithms" or some such, you should find descriptions of algorithms that do that. those rely on the araes being completely separated from each other, though, so the line detection step before would need to work very well.


Ping & DNS - updated with new look and Ping home screen widget
colton peterson
Ranch Hand

Joined: Nov 18, 2007
Posts: 97

Thank you. I looked around and I think I have found something that will work.

If anyone else has a problem like this go to http://www.noblemaster.com/public/download/FloodFill.java.html for some example code or to use. I avoided the line algorithm by using a black and white gif image
[ November 19, 2007: Message edited by: colton peterson ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: jpeg problems
 
Similar Threads
JPEG Image problem
Image Processiong using Java
Image IO problem
Colored pencils
Suggestion for image processing