Skip to content

Instantly share code, notes, and snippets.

View haschdl's full-sized avatar

Half Scheidl haschdl

View GitHub Profile
anonymous
anonymous / gist:7200880
Created October 28, 2013 17:20
Processing motion blur
/* passable motion blur effect using frame blending
* basically move your 'draw()' into 'sample()', time runs from 0 to 1
* by dave
* http://beesandbombs.tumblr.com
*/
int samplesPerFrame = 32; // more is better but slower. 32 is enough probably
int numFrames = 48;
float shutterAngle = 2.0; // this should be between 0 and 1 realistically. exaggerated for effect here
int[][] result;
@atduskgreg
atduskgreg / PWindow.pde
Last active November 15, 2023 13:29
Example of creating a Processing sketch with multiple windows (works in Processing 3.0)
class PWindow extends PApplet {
PWindow() {
super();
PApplet.runSketch(new String[] {this.getClass().getSimpleName()}, this);
}
void settings() {
size(500, 200);
}
@christopheranderton
christopheranderton / decoding-canon-icc-names.md
Last active September 24, 2022 20:21
Decoding Canon Printer ICC Profile Names (macOS/OS X/Others). Work in progress. Comment if you have any input, or if you see any issues.

Decoding Canon Printer ICC Profile Names

Work in progress.


Canon ICC Profile Naming Conventions

ICC Profiles from Canon follows a simple naming convention. The file always (with few exceptions) starts with Canon, and then the printer model number/name (or printer series), the paper/media type in short form sometimes with a number corresponding to the quality (usually on the scale 1-5, where the lower number is the highest quality, and the higher number is the lowest quality) of the slider in the Print Quality Dialog on your Operating System.

int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);
@marcduiker
marcduiker / ffmpeg_video_for_twitter.md
Last active June 1, 2024 04:35
FFmpeg command for creating video for Twitter

Convert pngs to mp4

This FFmpeg command reads images named frame_[4 char digit].png and converts it to an mp4 using the h264 encoding which Twitter accepts. The bitrate is set to 5M to reduce blocking as much as possible while keeping the size small.

ffmpeg -framerate 10 -i frame_%04d.png -c:v h264_qsv -b:v 5M video.mp4

Convert and scale an existing mp4 to 1080:

ffmpeg -i input.mp4 -c:v h264_qsv -vf: scale=1080:-1 -b:v 5M output.mp4