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 wand.image import Image, COMPOSITE_OPERATORS | |
from wand.drawing import Drawing | |
from wand.display import display | |
import sys | |
import os | |
import re | |
import glob | |
import pprint | |
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
(background "darkblue") | |
(def pts (point-cloud [119 139.203125] [216 53])) | |
(def pts2 (map (fn-sugar(vec2/+ % [133 91.203125])) pts)) | |
(style (fill "#FCC") | |
(map #(circle % 23) pts2) | |
) |
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
(def diagrams [ | |
(point-cloud [812 334.203125] [463 886.203125] [301 588.203125] [451 316.203125] [627 599.203125] [994 598.203125] [807 880.203125] [1180 328.203125] [1317 597.203125] [1164 889.203125] [643 59.203125] [990 61.203125] [994 1137.203125] [645 1140.203125]) | |
(point-cloud [812 334.203125] [463 886.203125] [301 588.203125] [450 317.203125] [627 599.203125] [994 598.203125] [807 880.203125] [1180 328.203125] [1317 597.203125] [1164 889.203125] [643 59.203125] [990 61.203125] [994 1137.203125] [645 1140.203125] [714 459.203125] [903 458.203125] [809 593.203125]) | |
(point-cloud [812 334.203125] [463 886.203125] [301 588.203125] [451 316.203125] [627 599.203125] [994 598.203125] [807 880.203125] [1180 328.203125] [1317 597.203125] [1164 889.203125] [643 59.203125] [990 61.203125] [994 1137.203125] [645 1140.203125] [719 458.203125] [903 465.203125] [809 593.203125] [946 528.203125] [856 529.203125] [901 595.203125]) | |
(point-cloud [812 334.203125] [463 886.203125] [301 588.203125] [451 316.203125] [6 |
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
#!/usr/bin/env python3 | |
import sys | |
import os | |
import ffmpeg | |
from pygifsicle import optimize | |
frames_path = sys.argv[1] | |
output_name = sys.argv[2] |
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
#!/bin/sh | |
# From http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html | |
# Usage: | |
# ./makegif.sh inputframes output.gif | |
# where inputframes is a directory containing .png frames | |
# Change size here | |
filters="scale=640:-1:flags=lanczos" |
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
#!/bin/sh | |
# usage: ./makemp4.sh export01 output01 | |
frames=`mktemp -d` | |
for i in 1 2 3; do | |
for file in $1/*.png; do | |
filename=$(basename "$file") | |
cp "$file" "$frames/$i-$filename" |
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
const sub = (a, b) => [ | |
a[0] - b[0], | |
a[1] - b[1], | |
]; | |
const distance = (a, b) => Math.sqrt( | |
Math.pow(a[0] - b[0], 2) + | |
Math.pow(a[1] - b[1], 2) | |
); |
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
#!/bin/sh | |
# From http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html | |
# Usage: | |
# ./makegif.sh export01 output.gif | |
palette="/tmp/palette.png" | |
filters="scale=640:-1:flags=lanczos" |
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 -r 60 -f rawvideo -pix_fmt bgra -s 1920x1080 -i - -threads 0 -preset veryslow -y -s 1920x1080 -color_primaries bt470bg -color_trc gamma28 -color_range jpeg -colorspace bt470bg -sws_flags lanczos+accurate_rnd+full_chroma_int+full_chroma_inp -pix_fmt yuv420p -crf 17 output.mp4 | |
-color_primaries bt470bg -color_trc gamma28 -color_range jpeg -colorspace bt470bg |
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
vec2 closestPointOnRepeatedLine(vec2 line, vec2 point){ | |
// Angle of the line | |
float a = atan(line.x, line.y); | |
// Rotate space so we can easily repeat along | |
// one dimension | |
pR(point, -a); | |
// Repeat to create parallel lines at the corners |
NewerOlder