On 8/26/05, Brian Schr?der <ruby.brian / gmail.com> wrote: > On 26/08/05, Joe Van Dyk <joevandyk / gmail.com> 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 Hm. I'm reading in from a file that has a bunch of RGB values from 0 to 256. So how can I set the pixel color of each pixel with that data?