Code Monkey home page Code Monkey logo

gfx-image's Introduction

GFX Image - Easy access to realtime shader effects on images using the GLFX library.

Usage

GFX Image takes a reference to an HTML element, or a selector string and replaces it with an image within a WebGL canvas element. Returns a reference to a GFXImage Element.

var gfxImage = GFXImage.('#imageElement', callback);

Methods

GFXImage.create ( target, callback )

Loads the given image into a WebGL enabled canvas element.

target - Selector string or reference to Image HTMLElement.

callback - Fires when GFXImage element is fully loadeda and ready to be displayed.

GFXImage Element

GFXImage Element contains references to these filters, which have their own properties that can be set.

With your GFXImage Element reference, enable filters by setting the appropriate filter's "enabled" property to true.

gfxImage.lensBlur.enabled = true;

Then, once the filter is enabled, you can set the filter's properties like this:

gfxImage.lensBlur.radius = 0;
gfxImage.lensBlur.brightness = 1;
gfxImage.lensBlur.angle = 0.66841;

List of supported filter properties

These properties are all derived from the GLFX library. Find examples and more detailed documentation on these filters here: http://evanw.github.io/glfx.js/demo/

Example usage:

gfxImageElement.<FILTER_NAME>.<FILTER_PROPERTY>

Filter Properties:

denoise

exponent

noise

amount

sepia

amount

vibrance

amount

triangleBlur

radius

edgeWork

radius

ink

strength

brightnessContrast

brightness

contrast

curves

red

green

blue

hueSaturation

hue saturation

unsharpMask

radius

strength

vignette

size

amount

lensBlur

radius

brightness

angle

tiltShift

startX

startY

endX

endY

blurRadius

gradientRadius

zoomBlur

centerX

centerY

strength

colorHalftone

centerX

centerY

angle

size

dotScreen

centerX

centerY

angle

size

hexagonalPixelate

centerX

centerY

lter

bulgePinch

centerX

centerY

radius

strength

matrixWarp

matrix

inverse

useTextureSpace

perspective

before

after

swirl

centerX

centerY

radius

angle

gfx-image's People

Contributors

craigthings avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.