From: "Brian Schröder" Date: 2005-08-26T18:43:45+09:00 Subject: Re: rmagick question On 26/08/05, Joe Van Dyk wrote: > I'm trying to set the pixels of an image: > > require 'RMagick' > > width = 512 > height = 256 > > image = Magick::Image.new width, height > > width.times do |x| > height.times do |y| > pixel = Magick::Pixel.new rand(256), rand(256), rand(256) > image.pixel_color x, y, pixel > end > end > > image.write ARGV.shift > > But the resulting image is all black. Why? > > Use Magick::MaxRGB+1 instead of 256. RGB Values range from 0...2**16. And be shure to check out the View funktionality. regards, Brian -- http://ruby.brian-schroeder.de/ Stringed instrument chords: http://chordlist.brian-schroeder.de/