From: jeljer te Wies Date: 2009-03-23T08:12:09+09:00 Subject: Re: convert PNG to hex Pascal J. Bourguignon wrote: > Well it's easy enough to do that with the methods I proposed > above. Something like: > > def decode(image) > i=0 > lastWhite=0 > bytes=[] > (0..(image.height)).each {| y | > (0..(image.width)).each {| x | > if image.pixelAt(x,y).isWhite? then > bytes.push(i-lastWhite) > lastWhite=i > end > i=i+1 > } > } > bytes > end > > (That's the reason why I proposed those methods). > > > Now you only have to implement them, doing the same: whish for methods > that would make implement the method pixelAt(x,y) easy, and do it. > Then further implement the missing methods. ah thanxs ! .. I will post the real answer as soon as I have got it ... (but that could take a while... my RMagick isn;t working... will google first though:P ) -- Posted via http://www.ruby-forum.com/.