Skip to content

Instantly share code, notes, and snippets.

@soh335
Created June 21, 2009 13:32
Show Gist options
  • Save soh335/133508 to your computer and use it in GitHub Desktop.
Save soh335/133508 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'RMagick'
img = Magick::ImageList.new("test.jpg")
for y in 0..img.rows-1
for x in 0..img.columns-1
c = img.pixel_color(x, y)
img.pixel_color(x,y, Magick::Pixel.new(c.red/2, c.green/2, c.blue/2))
end
end
img.write("test1.jpg")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment