Hello, I am doing this image processing programming for pseudocoloring.

aFile = File.new("mix.lut","w+")
for i in 0...256
red = i*i/255
green = Math.sqrt(i). to_i
blue = i
aFile.puts "#{red} #{green} #{blue}"
end
aFile.close

I made this simple color LUT, and i want to apply it to an image (RGB image). I could not figure it out what method to apply it.

What do you mean by applying to RGB image? Each file has its extension. You also need to follow the "binary" format of the file. What you did so far is simply written ASCII into a file (which means it is simply a .txt).