Skip to content

Instantly share code, notes, and snippets.

@littlebtc
Created August 23, 2012 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save littlebtc/3437891 to your computer and use it in GitHub Desktop.
Save littlebtc/3437891 to your computer and use it in GitHub Desktop.
big5-ansiart: GD vs Cairo
require 'rubygems'
gem 'ansi_art'
require 'ansi_art'
require 'benchmark'
doc = AnsiArt::Document.new(IO.read('803.ans'))
Benchmark.bm(10) do |x|
x.report("GD2") { File.open('out.png', 'wb') { |f| f.write(doc.to_png) } }
x.report("Cairo") { doc.to_png_cairo(800, :path => 'out.cairo.png') }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment