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
Take original image A, blur it to get image B. Then: | |
(A-B) * effectStrength + A | |
gives you output with lots more apparent detail. | |
It boosts contrast against surrounding pixels. A blur kernel with 1 pixel radius is equivalent to standard pixel sharpening, bigger blurs give a better effect but produce haloes around objects. You need a smarter blur that preserves edges to remove them. |
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
// Thanks to @brysonian | |
// https://github.com/processing/p5.js/issues/522#issuecomment-78510817 | |
var p5 = require("p5"); | |
var myp5 = new p5(function( sketch ) { | |
sketch.setup = function() { | |
var cnv = sketch.createCanvas(500, 500); | |
sketch.colorMode(sketch.HSB, 360, 100, 100); | |
sketch.noStroke(); | |
}; |
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
Hey p5js people, | |
I recently started using p5.js. After transitioning from Processing to | |
Prcoessing.py, p5.js seems like a good step to go. Thanks for making this | |
possible, and I expect to be contributing to the Github page soon. | |
At the moment there aren't a lot of real-time conversation places for p5.js. I | |
have found the Education Page, the Forum, and of course the GitHub Issues page. | |
There are great, searchable resources, but no direct access to human resources. |
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
// Util functions | |
var Util = { | |
loop: function (obj, callback) { | |
for (var x in obj) { | |
if (obj.hasOwnProperty(x)) { | |
callback(x, obj[x]); | |
} | |
} | |
return obj; | |
} |
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
# Step 0: save git-deploy-master somewhere in your $PATH and make sure it has execute permission. | |
# in master, commit your code | |
git commit -m "Updated website" | |
# Deploy to gh-pages | |
git deploy-master |
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 | |
'''Breaks large tab-separated value files into smaller files''' | |
import argparse | |
def split_tsv(filepath, lines, limit): | |
header = [] | |
with open(filepath, 'r') as f: | |
# Assume there is header | |
header = f.readline().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
var i = 0; | |
function makeChartFromList(list) { | |
function consume ( data ) { | |
process(data); | |
i++; | |
if (i === list.length) { | |
$.Deferred().resolve(); | |
} else { |
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
PGraphics gStuff; | |
int w = 400; | |
int h = 300; | |
void setup () { | |
size(w, h); | |
gStuff = createGraphics(w, h); | |
} | |
void draw() { |
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
function TouchScreenAdapt() | |
{ | |
if (typeof TouchEvent != "undefined") | |
{ | |
$('body').removeClass('mouse').addClass('touch'); | |
} | |
} |
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
// Because HTML5 Audio support isn't all that consistent, we need to do something. | |
// With at least both .ogg and .mp3 formats, they will play on all 5 major | |
// browsers on the desktop. | |
// XXX If more ancient support is desired, feel free to add <embed> support. Or Flash. | |
// | |
// sources should be a list of audio files of the same sound, but in different formats. | |
// e.g.: ['effect.ogg', 'effect.mp3', 'effect.wav'] | |
// Depending on the browser capability, it will only add one of them that is playable. | |
// If no compatible format is found for that browser, a warning will be issued. | |
// List of Audio MIME Types: |
OlderNewer