Advertisement
You do this:F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F I R E F O X F You do know what this is, no?#!/ur/local/bin/ruby
# $premshree$ $2005-03-18 03:13$
require 'GD'
include GD
img = Image.newFromPng(File.new('firefox.png', 'rb'))
text = 'FIREFOX'
width = img.width
height = img.height
temps = [0]*3
skip_pixels = 1
skip_lines = 2
char_next = 0
print '<pre style="background: #FFFFFF">'
height.times { |i|
if temps[2] == 0
width.times { |j|
if temps[1] == 0
idx = img.getPixel(j, i)
color = img.rgb(idx)
print "<span style=\"color: rgb(#{color[0]}, #{color[1]},
#{color[2]}); font-size:10px;\">#{text.split('')[char_next]}</span>"
char_next = char_next + 1
if char_next == text.split('').length then char_next = 0 end
end
temps[1] = temps[1] + 1
if temps[1] == skip_pixels then temps[1] = 0 end
if temps[0] == width
print '<br />'
temps[0] = 0
end
temps[0] = temps[0] + 1
}
end
temps[2] = temps[2] + 1
if temps[2] == skip_lines then temps[2] = 0 end
}
print '</pre>' Original image here .
Read: While things compile...