Created
March 25, 2014 22:06
-
-
Save roshkins/9772469 to your computer and use it in GitHub Desktop.
Here is how I generated my image...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'RMagick' | |
include Magick | |
img = Image.new(1000,1000) | |
def fib_arr(num) | |
return [1] if num == 1 | |
return [1,1] if num == 2 | |
nums = fib_arr(num-1) | |
return nums + [nums[-1] + nums[-2]] | |
end | |
fib_nums = fib_arr(3000) | |
def z(x, y, fib_nums) | |
y*fib_nums[x] % MaxRGB | |
end | |
1000.times do |y| | |
1000.times do |x| | |
r = z(x*3,y, fib_nums) | |
g = z(x*3+1,y, fib_nums) | |
b = z(x*3+2,y, fib_nums) | |
# puts "#{x}, #{y}: r #{r} g #{g} b #{b}" | |
p = Pixel.new(r, g, b, 0) | |
# p "#{p}" | |
img.pixel_color(y, x, p) | |
# p "#{img.pixel_color(x,y)}" | |
end | |
# img.display if y % 50 == 0 | |
end | |
img.display |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment