FaeriCode

Hello! I'm a college student with a major in Computer Science, and this blog will be an inventory of all the codes I come across. You're welcome to use these codes for whatever you like. Thanks for stopping by!

Wednesday, December 18, 2013

Grayscale a Picture

def grayScale(picture):
  for p in getPixels(picture):
    intensity = (getRed(p)+getGreen(p)+getBlue(p))/3
    setColor(p, makeColor(255-intensity, 255-intensity, 255-intensity))
  repaint(picture)
Posted by FaeriMagic at 6:47 AM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: Fall 2013, Jython (JES)

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Pages

  • Home
  • Jython (JES)
  • Finch

Blog Archive

  • ▼  2013 (27)
    • ▼  December (27)
      • SlideShow Code
      • Echo a Sound
      • Produce a Negative
      • Mix Three Sounds
      • Interleave Two Sounds
      • Mix Two Sounds
      • Double the Frequency
      • Reverse a Sound
      • Copy a Sound into a Target
      • Clip a Sound
      • XOR
      • Finch Orientation
      • Enlarge an Image
      • Shrink an Image
      • Make the Finch say Something
      • Mirror an Image Vertically
      • Mirror an Image Horizontally
      • Grayscale a Picture
      • Randomizes the RGB Values in each Pixel
      • Change the Color of the Finch's Beak (+ Moving the...
      • Moving the Finch
      • Halve the sound's frequency
      • Shift all samples up by 32767
      • Make the bottom-right corner white
      • Set all Red values to Blue
      • Increase Volume in a Sound by 2
      • Increase the Blue in a Picture by 2

About Me

FaeriMagic
View my complete profile
Awesome Inc. theme. Powered by Blogger.