All Projects → Wildhoney → Legofy

Wildhoney / Legofy

Licence: other
Legofy your images with retina support using SVG.

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Legofy

jqCandlestick
jQuery plugin for creating line, bar and candlestick charts.
Stars: ✭ 13 (-95.37%)
Mutual labels:  canvas
Zimjs
ZIM JavaScript Canvas Framework - Code Creativity! Interactive Media For All.
Stars: ✭ 259 (-7.83%)
Mutual labels:  canvas
Code To Image
Convert blocks of code to a highlighted jpeg base64 image.
Stars: ✭ 271 (-3.56%)
Mutual labels:  canvas
Simple Draw
A canvas you can draw on with different colors.
Stars: ✭ 256 (-8.9%)
Mutual labels:  canvas
Front Ui
😄 🎨 Collect some front-end special effects (收集一些前端特效)
Stars: ✭ 259 (-7.83%)
Mutual labels:  canvas
Dynamic effect
平时练习的一些前端动效,基于HTML5,CSS3,Canvas,Svg
Stars: ✭ 264 (-6.05%)
Mutual labels:  canvas
audio-oscilloscope
Audio oscilloscope in canvas.
Stars: ✭ 28 (-90.04%)
Mutual labels:  canvas
Html5 Canvas Animation
🚀 3D lines animation with three.js
Stars: ✭ 278 (-1.07%)
Mutual labels:  canvas
Flutter Canvas
About using of canvas in the flutter
Stars: ✭ 259 (-7.83%)
Mutual labels:  canvas
Canvas Designer
Collaborative, extendable, JavaScript Canvas2D drawing tool, supports dozens of builtin tools, as well as generates JavaScript code for 2D animations.
Stars: ✭ 268 (-4.63%)
Mutual labels:  canvas
Isomer
Isomer is an easy-to-use graphics library for drawing isometric scenes.
Stars: ✭ 2,767 (+884.7%)
Mutual labels:  canvas
Canvg
Javascript SVG parser and renderer on Canvas
Stars: ✭ 2,963 (+954.45%)
Mutual labels:  canvas
Sessions
A series of creative coding sessions
Stars: ✭ 262 (-6.76%)
Mutual labels:  canvas
UltraTypeBot
A fast, easy to use bot for NitroType.com
Stars: ✭ 24 (-91.46%)
Mutual labels:  canvas
Fediagram
图说前端>>收集各种前端技术图谱 🚕🚖🚗🚚🚛🚜
Stars: ✭ 273 (-2.85%)
Mutual labels:  canvas
Pancake
Lightweight, Fast, Easy-to-use HTML5 2D game framework!
Stars: ✭ 79 (-71.89%)
Mutual labels:  canvas
Earthbound Battle Backgrounds Js
A JavaScript project that generates all the Earthbound/Mother 2 backgrounds.
Stars: ✭ 258 (-8.19%)
Mutual labels:  canvas
Dygraphs
Interactive visualizations of time series using JavaScript and the HTML canvas tag
Stars: ✭ 2,953 (+950.89%)
Mutual labels:  canvas
Beziermaker.js
arbitrary order bézier-curve generator
Stars: ✭ 277 (-1.42%)
Mutual labels:  canvas
Smartchart
一款android 图表框架,支持图表N配置,支持缩放,旋转手势。
Stars: ✭ 266 (-5.34%)
Mutual labels:  canvas

Legofy

Based entirely on the Python implementation.

Travis   npm   License MIT   Heroku

Screenshot

Getting Started

Simply import the transform function from the Legofy module, and then invoke it by passing in your img element.

import {transform} from 'legofy';

// ...

const imgElement = document.querySelector('img');
transform(imgElement);

Options

Brick Size

You can adjust the size of the bricks by using the second argument of the transform function — by default the factor is 0.05.

// ...

// Make the bricks twice the size of the default.
transform(imgElement, { factor: 0.1 });

// ...Or make them twice as small!
transform(imgElement, { factor: 0.025 });

As the brick isn't currently SVG — see ticket — larger bricks will look blurry.

Blend Mode

You can also change the mix-blend-mode value using the second argument — the default is overlay however screen, darken, color-burn, hard-light, soft-light all look good as blend modes.

// ...

// Change bricks to a more pastel colour.
transform(imgElement, { blendMode: 'screen' });

Re-rendering

By default when the window is resized no re-rendering will occur — it's entirely up to the developer to invoke transform again – and thankfully the transform function is idempotent.

import {throttle} from 'lodash';
import {transform} from 'legofy';

// ...

const imgElement = document.querySelector('img');
transform(imgElement);

//  ...
addEventListener('resize', throttle(() => transform(imgElement), 250));

Browser Support

Tested with Chrome 46.0, Firefox 42.0, Safari 9.0.1, Opera 33.0.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].