#!/usr/local/bin/ruby # # ./image_newfromxbm.rb > image_newfromxbm.gif require "GD" file = open("image_newfromxbm.xbm", "rb") im = GD::Image.newFromXbm(file) file.close # allocate some colors white = im.colorAllocate(255,255,255) black = im.colorAllocate(0,0,0) red = im.colorAllocate(255,0,0) green = im.colorAllocate(0,255,0) blue = im.colorAllocate(0,0,255) yellow = im.colorAllocate(255,250,205) im.gif STDOUT