Skip to content

Instantly share code, notes, and snippets.

View malanx's full-sized avatar

Jordan Malan malanx

View GitHub Profile
@Lemmings19
Lemmings19 / productive.js
Created May 2, 2017 22:16
Another day at the office...
console.log('yo dawg' + console.log('we heard you liked logs' + console.log('so we put a log in your log' + console.log('so you could log while you log'))));
@pgchamberlin
pgchamberlin / DominantColours.php
Last active December 12, 2020 21:11
PHP class to extract dominant colours from an image using K-Means clustering. This features an extremely rough-and-ready (read: inefficient) implementation of K-Means which I wrote to run on PHP < 5.3. If you can use an up-to-date build of PHP then you can take advantage of some proper implementations that proper maths-type people have written f…
<?php
/**
* Dominant colours by k means derived from code by Charles Leifer at:
* http://charlesleifer.com/blog/using-python-and-k-means-to-find-the-dominant-colors-in-images/
*
* MagickWand docs: http://www.magickwand.org/
*
* Color transformation algorithms from EasyRGB: http://easyrgb.com/
*