def []= (x,y,obj)
      if x.instance_of? Fixnum and y.instance_of? Fixnum
        set_pixel(x,y,obj)
      else
        x = (x..x) if x.instance_of? Fixnum
        y = (y..y) if y.instance_of? Fixnum

        width = x.count
        (0..y.count-1).each do |y_|
          origpointer = y_*obj.width*3
          destpointer = ((y.first + y_)*self.width + x.first)*3

          self.pixel_data[destpointer..destpointer+obj.width*3-1] =
            obj.pixel_data[origpointer..origpointer+obj.width*3-1]

        end
      end
    end
def []= (x,y,obj)
      if x.instance_of? Fixnum and y.instance_of? Fixnum
        set_pixel(x,y,obj)
      else
        x = (x..x) if x.instance_of? Fixnum
        y = (y..y) if y.instance_of? Fixnum

        width = x.count
        (0..y.count-1).each do |y_|
          origpointer = y_*obj.width*3
          destpointer = ((y.first + y_)*self.width + x.first)*3

          self.pixel_data[destpointer..destpointer+obj.width*3-1] =
            obj.pixel_data[origpointer..origpointer+obj.width*3-1]

        end
      end
    end
Set the color of a pixel locate in the given x and y coordinates
 or replace a rectangle section of the image with other image of equal dimensions
 if a range is specified

 Example

   image[0,0] = Color.red # set the color of pixel at 0,0 to Color.red
   image[0..20,10..30] = other_image # replace the rectagle with x between 0 and 20 and y between 10 and 30 with other_image