home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / ai / neuraln / 3004 < prev    next >
Encoding:
Internet Message Format  |  1992-07-28  |  3.3 KB

  1. Path: sparky!uunet!ogicse!pnl-oracle!duke!d3g637
  2. From: d3g637@duke.oname (David P. Chassin)
  3. Newsgroups: comp.ai.neural-nets
  4. Subject: Re: ALGORITHM NEEDED:  Palette Selection
  5. Message-ID: <1992Jul28.203224.19657@oracle.pnl.gov>
  6. Date: 28 Jul 92 20:32:24 GMT
  7. Article-I.D.: oracle.1992Jul28.203224.19657
  8. References: <Bs1wLE.82z@undergrad.math.waterloo.edu>
  9. Sender: news@oracle.pnl.gov
  10. Reply-To: d3g637@duke.oname
  11. Organization: Battelle/Pacific Northwest Laboratories
  12. Lines: 61
  13.  
  14. In article 82z@undergrad.math.waterloo.edu, icfaragh@cayley.waterloo.edu (Chad Faragher) writes:
  15. >
  16. >The situation:  An image is stored by giving the rgb value for each pixel.
  17. >The problem:  How to find the best palette of size-n for a particular image
  18. >stored (at arbitrary resolution) as above.
  19. >The solution:  HELP!!!
  20. >
  21. >Does the algorithm exist?  Is it memory intensive?  Can it be solved with 
  22. >recursion (ie octree division)? 
  23.  
  24. If my memory serves me an approach to such a beast is to figure out a
  25. 3D histogram (RGB axes) of the image.  Then select the
  26. regions with the highest density of entries and define colors for each
  27. region.  You need to define the permissible deviation from the original
  28. color.  The greater the permissible deviation the fewer palette entries
  29. you will need.  The relationship between the deviation and the number
  30. of entries is understandably unique to each image.  The net result of
  31. this operation is a table which defines RGB values for each entry in
  32. the table.  Then you go through each pixel in the image and map it
  33. to the palette entry by finding which entry's RGB values are closest to
  34. the pixels value.  Note that the RGB value you choose at a given 
  35. entry may not _actually_ occur in the image, but may instead be
  36. a kind of local centroid. 
  37.  
  38. BTW: a three dimensional histogram is a ***VERY*** memory intensive
  39. affair.  There are ways around that problem though.  For example you
  40. don't actually allocate a 256x256x256 histogram (assuming 24 bit RGB images)
  41. table but simply record them as you go along.  Then again, there's a
  42. speed cost.
  43.  
  44. >Can a neural-net be trained to arrive at
  45. >a visually pleasing palette given the original image?
  46. >All input welcome.
  47. >Chad Faragher -- University of Waterloo
  48.  
  49.  
  50. I can conceive of a neural net to do such a thing, but WOW!  You could
  51. for example use a 256x256x256 input layer and a n-sized (palette entries)
  52. output layer with RGB values.  Better yet you might simply provide the
  53. image as an input and the palette as the output. 
  54. I'm not very confident of these schema though,
  55. they seems neither practical nor effective.  The training might work for a
  56. given type of image, but I'm not sure it would work for all types.
  57. I wonder if anyone's had any more practical ideas. It does sound like something
  58. worth pursuing.  Neural Nets have been used for stock market analysis and that's
  59. also a multidimensional statistical problem. Who knows...
  60.  
  61. BTW: how do you define visually pleasing?  I consider the algorithm effective
  62. iff I cannot distinguish between the original and the compressed image on
  63. a given medium.  It's a pretty binary test, and has little to do with pleasure.
  64. Of course the medium of display is important to consider.
  65.  
  66.  
  67.         Dave Chassin
  68.         Email: dp_chassin@pnl.gov           "Life is either a daring
  69.         Vox: (509)375-4369                    adventure or nothing"
  70.         Fax: (509)375-3614                           - Helen Keller
  71.