Skip to content

Instantly share code, notes, and snippets.

View nbremer's full-sized avatar

Nadieh Bremer nbremer

View GitHub Profile
global.THREE = require("three");
const canvasSketch = require('canvas-sketch');
const Random = require('canvas-sketch-util/random');
const gradientHeight = 512;
const settings = {
dimensions: [ 2048, gradientHeight * 2 ]
};
@lqt0223
lqt0223 / g.md
Last active January 10, 2023 00:08
14 Simple algorithm for chromatic aberration effect in JavaScript

Chromatic aberration effect - a simple implementation in JavaScript

A chromatic aberration is an optical effect caused by one or more color channels being displaced. Although it is an optical failure and should be avoided for displaying or image capturing devices, chromatic aberration can be used to make graphics be more realistic in some other applications like 3D games.

The following codes is an example of implementing the effect using ImageData API of HTML5 canvas. By fetching and manipulating pixel data of the image, the chromatic aberration effect is easy to achieve.

<html>
<body>
<canvas id="canvas"></canvas>
@brendandawes
brendandawes / tools.md
Last active November 5, 2023 22:32
[Work in Progress] Tools — a constantly expanding list of some of the tools and services I use to make things, both hardware and software. Things can only appear on this list if it's something I've personally used to make things.