Skip to content

Instantly share code, notes, and snippets.

@staybuzz
Created January 30, 2015 18:09
Show Gist options
  • Save staybuzz/3a65af51df992d56c48b to your computer and use it in GitHub Desktop.
Save staybuzz/3a65af51df992d56c48b to your computer and use it in GitHub Desktop.
require 'rmagick'
#include Magick
white = Magick::Pixel.new(255*256,255*256,255*256)
img1 = Magick::Image.read('sample6.jpg').first
img1.each_pixel {|pixel,x,y|
if pixel.to_color != "red" then
img1.pixel_color(x,y,white)
end
}
img1.write('out.jpg')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment