From: Joe Van Dyk Date: 2005-08-26T13:33:07+09:00 Subject: Re: rmagick question On 8/25/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? And here's some code from my actual application: pixel = Magick::Pixel.new(*rgb) puts "The image pixel was: <#{ image.pixel_color(e, n) }>" image.pixel_color(e, n, pixel) puts "The pixel was <#{ pixel }>" puts "The image pixel is now: <#{ image.pixel_color(e, n) }>" And here's the result: The image pixel was: The pixel was The image pixel is now: Why on earth isn't it setting the pixel color on the image?