Displaying articles with tag

E Pluribus Venom

Posted by hank, Tue Jan 01 22:18:00 UTC 2008

This has to be one of the coolest works of art I’ve ever seen.

E Pluribus Venom

Find more information here. Find more art here.

Tags:

Sombrero Spitzer Galaxy Wallpaper

Posted by hank, Sun Aug 19 04:30:00 UTC 2007

I happened to find this today and thought it would make a nice wallpaper. I converted it into a 1600x1200 image. Here it is:

Sombrero Spitzer

Tags:

Automagic blending of wallpapers using RMagick

Posted by hank, Tue Jul 24 00:00:00 UTC 2007

I wanted a program that let me blend random wallpapers from a directory together and set them every minute with increasing opacity on one image, and then to select a new random image and repeat the process. I did this using RMagick and some Ruby.

Make the following tree:


~/.wallmold/
  current.yml

Fill current.yml with this:


--- 
file2: someimage
wallpaperdir: wallpaper directory
dissolution: 0.1
file1: anotherimage

Replacing the image names and directory with the proper stuffs, full path on directory and relative on image names. Here’s mine:


--- 
file2: w09.jpg
wallpaperdir: /home/hank/MyDocs/Wallpapers
dissolution: 0.8
file1: Looking_Forward.jpg

Then, get this, make it executable, and put it somewhere:


#!/usr/bin/env ruby
# Wallmold - a wallpaper melding script
require 'RMagick'
require 'yaml'

class Array
  def randomize
   arr=self.dup
   arr.collect { arr.slice!(rand(arr.length)) }
  end

  def randomize!
   arr=self.dup
   result = arr.collect { arr.slice!(rand(arr.length)) }
   self.replace result
  end
end

# Load State
configpath = "#{ENV['HOME']}/.wallmold/current.yml"
configfile = File.open(configpath, 'r')
config = YAML.load(configfile)
out = "#{ENV['HOME']}/.wallmold/dissolve.jpg"

# Open the Wallpaper directory
dir = Dir.open(config['wallpaperdir'])
newconfig = config

if config['dissolution'] == 0.9
  # Get new images
  files = dir.to_a.randomize

  newconfig['file1'] = config['file2']
  newconfig['file2'] = files.pop
  newconfig['dissolution'] = 0.1
else
  newconfig['file1'] = config['file1']
  newconfig['file2'] = config['file2']
  newconfig['dissolution'] = config['dissolution'] + 0.1
end

bgnd = Magick::Image.read(dir.path+"/"+newconfig['file1']).first
overlay = Magick::Image.read(dir.path+"/"+newconfig['file2']).first

# Make the first image is the same size as the second
bgnd.crop_resized!(overlay.columns, overlay.rows)

composited = bgnd.dissolve(overlay, newconfig['dissolution'])
composited.write(out)

`fbsetbg #{out}`

# Write new config
configfile.close
configfile = File.open(configpath, 'w')
configfile.puts newconfig.to_yaml

Now, just edit your crontab:


* * * * * DISPLAY=:0 ruby -r rubygems /home/hank/bin/wallmold.rb > /dev/null 2>&1

Tags: