#!/usr/local/bin/ruby # # ./interlace.rb > interlace.gif require "GD" # create a new image im = GD::Image.new(200, 200) # 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) STDERR.print im.interlace, "\n" im.interlace = TRUE STDERR.print im.interlace, "\n" im.filledRectangle(0, 0, 50, 50, red) im.filledRectangle(50, 0, 100, 50, green) im.filledRectangle(0, 50, 50, 100, blue) im.filledRectangle(50, 50, 100, 100, yellow) im.gif STDOUT