Greyscale as well as colour images can be inverted. This example shows how to do this.

#!/usr/bin/env ruby
require 'hornetseye'
raise "Syntax: invert.rb <input image> <output image>" if ARGV.size != 2
( 255 - Hornetseye::MultiArray.load_ubytergb( ARGV[0] ) ).save_ubytergb ARGV[1]