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
/** | |
* Provides requestAnimationFrame in a cross browser way. | |
* @author paulirish / http://paulirish.com/ | |
*/ | |
if ( !window.requestAnimationFrame ) { | |
window.requestAnimationFrame = ( function() { | |
return window.webkitRequestAnimationFrame || |
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
ffmpeg -i out.ogv -s 160x128 -pix_fmt rgb24 -ss 62.6 -t 3 -r 5 -loop 0 -f gif out.gif | |
convert -loop 0 -layers Optimize out.gif outopt.gif |
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
var canvas = document.createElement( 'canvas' ); | |
canvas.width = 2048; | |
canvas.height = 2048; | |
canvas.addEventListener( 'click', function() { | |
window.open( canvas.toDataURL( 'image/png' ), 'mywindow' ); | |
}, false ); |
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
ffmpeg -i image_%04d.png -r 14 -sameq test.webm |
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
from PIL import Image | |
import glob, os | |
scale = 0.5 | |
for infile in glob.glob( "*.png" ): | |
file, ext = os.path.splitext( infile ) | |
im = Image.open( infile ) | |
im = im.resize( ( int( im.size[ 0 ] * scale ), int( im.size[ 1 ] * scale ) ) ) |
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
from PIL import Image | |
import glob, os | |
scale = 0.5 | |
for infile in glob.glob( "*.png" ): | |
file, ext = os.path.splitext( infile ) | |
im = Image.open( infile ) | |
im = im.resize( ( int( im.size[ 0 ] * scale ), int( im.size[ 1 ] * scale ) ) ) |
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
from PIL import Image | |
import glob, os | |
scale = 0.5 | |
for infile in glob.glob( "*.png" ): | |
file, ext = os.path.splitext( infile ) | |
im = Image.open( infile ) | |
im = im.resize( ( int( im.size[ 0 ] * scale ), int( im.size[ 1 ] * scale ) ) ) |
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
from PIL import Image | |
import glob, os | |
for infile in glob.glob( "*.png" ): | |
file, ext = os.path.splitext( infile ) | |
im = Image.open( infile ) | |
im.load() | |
r, g, b, a = im.split() |
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
import time | |
import datetime | |
from stat import * | |
#returns a list of all the files on the current directory | |
files = os.listdir('.') | |
for f in files: | |
#my folder has some jpegs and raw images | |
if f.lower().endswith('jpg'): |
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
// CLIENT (PER FRAME) | |
var formData = new FormData(); | |
formData.append( 'filename', 'frame' + ( count ++ ) + '.png' ); | |
formData.append( 'data', canvas.toDataURL( 'image/png' ) ); | |
var xhr = new XMLHttpRequest(); | |
xhr.open( 'POST', 'http://127.0.0.1:1337/' ); | |
xhr.send( formData ); |