def set_pixel(x,y,color)

      index = (y*@width + x)
      pointindex = index*3
      @array[pointindex+2] = color.r.chr
      @array[pointindex+1] = color.g.chr
      @array[pointindex] = color.b.chr

      if color.a != 255 then
        @alpha = 255.chr*(@height * @width) unless @alpha
        @alpha[index] = color.a.chr
      end

      self
    end
def set_pixel(x,y,color)

      index = (y*@width + x)
      pointindex = index*3
      @array[pointindex+2] = color.r.chr
      @array[pointindex+1] = color.g.chr
      @array[pointindex] = color.b.chr

      if color.a != 255 then
        @alpha = 255.chr*(@height * @width) unless @alpha
        @alpha[index] = color.a.chr
      end

      self
    end
Creates a duplicate of the image
 set a color value for a image