• 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

jpeg problems

 
Ranch Hand
Posts: 97
Python VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Python VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic