Skip to content

Javascript dynamic <img> source generator using HTML5 Canvas API.

License

Notifications You must be signed in to change notification settings

denisahac/dynamic-images

Repository files navigation

Image Source Generator

A Javascript utility for generating an <img> source . It uses the HTML5 Canvas API to generate the image BLOB.

Screenshot

Dynamic Images

Installation

Using bower

bower install --save-dev dynamic-images

Usage

<img src="" data-dynamic/>
<img src="" data-dynamic data-width="500"/>
<img src="" data-dynamic data-height="200"/>
<img src="" data-dynamic data-background="yellow"/> 
<img src="" data-dynamic data-widt="500" data-height="200" data-background="yellow"/>
<script src="bower_components/dynamic-images/dist/dynamic-images.min.js"></script>
<script>
	new DynamicImages({
		width: 200,
		height: 200
	});
</script>

Options

When not specified the default value is used.

  • width defaults to 150px
  • height defaults to 150px
  • background defaults to #ccc

License

GNU