Skip to content

Instantly share code, notes, and snippets.

@JPLeBreton
JPLeBreton / pil_test.py
Created August 11, 2015 23:55
PIL/Pillow test: crash converting transparent GIF to RGB
import os.path
from PIL import Image
# image URLs for the two images used below:
# http://vectorpoem.com/images/grad.gif
# http://vectorpoem.com/images/grad2.gif
def convert_image(src_img_filename):
# convert source image to RGB, then convert it to an arbitrary test palette
print('reading %s...' % src_img_filename)
@JPLeBreton
JPLeBreton / retrofilter
Created December 28, 2014 01:31
Shell script to run Retrofilter on an image, in Linux using Wine
cp "$1" /tmp
infilewithext=`basename "$1"`
infile=`basename "$1" | cut -d\. -f1`
convert /tmp/$infilewithext -type TrueColor /tmp/$infile.tga
wine ~/wine_c/retrofilter/Retrofilter.exe /tmp/$infile.tga
convert /tmp/$infile.crt.tga $infile-crt.png
@JPLeBreton
JPLeBreton / twitch_stream.sh
Created October 21, 2012 21:47
shell script for streaming to twitch.tv
#! /bin/bash
# from
# https://gist.github.com/3178130
# gist created by brodul
# modified for http://twitch.tv/jplebreton
# originaly from http://tinyurl.com/twitch-linux from taladan
# www.youtube.com/user/taladan