Skip to content

Instantly share code, notes, and snippets.

@gifguide2code
gifguide2code / Color_Extractor.py
Created June 10, 2018 18:17
A Python script to filter out pixels with a red value higher than 30.
from PIL import Image
im = Image.open('C:\\Users\\Desktop\\HexTest.png')
pix = im.load()
width = im.size[0]
height = im.size[1]
new_im = Image.new('RGB', (width,height), "white")
new_pix = new_im.load()
@gifguide2code
gifguide2code / History_In_Images.pde
Created May 20, 2018 23:17
A sketch incorporating images saved in the sketch folder into a vertical timeline.
int year = 0;
int y = 0;
int spacing = 50;
PImage[] imgs = new PImage[11];
String[] dates= new String[11];
String[] desc = new String [11];
void setup(){
String path = sketchPath();
String[] filenames = listFileNames(path);
@gifguide2code
gifguide2code / Static-DeCipherer.pde
Created May 13, 2018 03:31
This sketch pulls out messages hidden by the Static-Cipher.pde.
void setup() {
size(600,600);
PImage Garbled = loadImage("Message.png");
PImage Message = createImage(width,height,ARGB);
Garbled.loadPixels();
for (int x = 0; x<width;x++) {
for (int y = 0; y <height; y++) {
int loc = x + y*width;
float r = red(Garbled.pixels[loc]);
float g = green(Garbled.pixels[loc]);
@gifguide2code
gifguide2code / Static-Cipher.pde
Last active May 13, 2018 03:34
This sketch hides messages in images of static.
void setup() {
size(600,600);
int step = 2;
int imgx = 0;
int imgy = 0;
int rand = 0;
PImage Poltergeist = loadImage("Poltergeist.png");
PImage Img = createImage(width,height,ARGB);
Poltergeist.loadPixels();
for (int x = 0; x<width;x++) {
@gifguide2code
gifguide2code / Timeline.pde
Created May 5, 2018 13:30
A sketch to get a timeline that moves forward and backward when you move the mouse.
int year = 0;
int y = 0;
int spacing = 50;
void setup(){
size(500,800);
background(0);
textSize(25);
fill(255,255,255);
for (int i = year; i<2018; i=i+25){
@gifguide2code
gifguide2code / Script-Scraper
Created April 15, 2018 18:20
A VBA web scraper to bulk copy the HTML from http://www.imsdb.com/scripts/.
Sub Scrape()
'Create an array of movie names
Dim Movies()
Movies = Array("Alien", "Avatar", "Blade-Runner", "Gattaca", "Ghostbusters", "Jurassic-Park", "Looper", "Lost-in-Space", "Sphere", "Signs", "Spider-Man", "Terminator", "V-for-Vendetta")
'Loop through each item in the movie array
For x = LBound(Movies) To UBound(Movies)
ActiveDocument.StoryRanges(wdMainTextStory).Delete
@gifguide2code
gifguide2code / chat.py
Last active April 8, 2018 04:31
A function to automate setting shape keys for a mouth on a mesh in Blender.
import bpy
import random
def chat(speech, speed):
slist = list(speech)
mouth = bpy.data.objects['Mouth']
face = bpy.data.objects['Face']
f = 1
for x in slist:
if (x=="a") or (x=="e") or (x=="i") or (x=="o") or (x=="u") or (x=="y"):