Skip to content

Instantly share code, notes, and snippets.

@GoToLoop
GoToLoop / CircleMutualAttraction.pyde
Last active March 30, 2018 04:05 — forked from Speykious/CircleMutualAttraction
This is an example for the library Fisica for Processing in Python.
"""
CircleMutualAttraction (v2.3.8)
by Speykious (2017-Jun-27)
mod GoToLoop (2017-Jun-29)
https://Forum.Processing.org/two/discussion/23226/
new-python-example-for-the-fisica-library#Item_2
https://Gist.GitHub.com/GoToLoop/1861619991354ed7d063026658270689
"""
@GoToLoop
GoToLoop / resizeNN.js
Last active June 6, 2023 18:11 — forked from gncgnc/resizeNN.js
Extends p5.Image to handle nearest neighbor resizing for scaling images w/o blurring.
/**
* Resize the image to a new width and height using nearest neighbor algorithm.
* To make the image scale proportionally,
* use 0 as the value for the wide or high parameters.
* For instance, to make the width of an image 150 pixels,
* and change the height using the same proportion, use resize(150, 0).
* Otherwise same usage as the regular resize().
*
* Note: Disproportionate resizing squashes "pixels" from squares to rectangles.
* This works about 10 times slower than the regular resize.