Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jpeg problems

 
colton peterson
Ranch Hand
Posts: 97
Linux Python VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
colton peterson
Ranch Hand
Posts: 97
Linux Python VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic