Created
January 11, 2011 03:35
-
-
Save mmb/773973 to your computer and use it in GitHub Desktop.
convert image into retro 8-bit looking 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' | |
# convert image intro retro 8-bit looking image | |
# http://matthewm.boedicker.org/ | |
# find NES, SNES, etc. palette image on the web | |
palette = Magick::ImageList.new('/tmp/Palette_NTSC.png') | |
img = Magick::ImageList.new('/tmp/input.jpg') | |
orig_width, orig_height = img.columns, img.rows | |
img.remap(palette, Magick::NoDitherMethod) | |
img.scale!(0.10) | |
img.sample!(orig_width, orig_height) | |
img.write('/tmp/out.jpg') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment