Skip to content

mahonnaise/colorizeImage.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#colorizeImage.js (Demo)

colorizeImage.js is small library for colorizing product images on the client side. It uses HTML5's canvas element if possible and Flash as fallback.

All you need is a white product image, a mask image thereof, and a few hex colors.

illustration

[T-Shirt photo borrowed from Wikipedia]

#Usage

##Markup

<div data-base="shirt-base.jpg" data-mask="shirt-mask.jpg" data-swf="../swf/colorizeImage.swf"></div>
  • data-base – path to the base image
  • data-mask – path to the mask image
  • data-swf – path to the swf file

##Invocation

window.colorizeImage(element, hex);
  • element – the DOM node
  • hex – a 6 character hex color

#Compatibility

  • any recent browser
  • IE versions as old as 6 (the demo's CSS doesn't work in IE6)

About

on-the-fly colorization of product images

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published