All Projects → gillyb → Reimg

gillyb / Reimg

Licence: other
reimg - A javascript library for converting image formats

Projects that are alternatives of or similar to Reimg

Anime
JavaScript animation engine
Stars: ✭ 41,064 (+38639.62%)
Mutual labels:  svg, canvas, javascript-library
Graphicsjs
A lightweight JavaScript graphics library with the intuitive API, based on SVG/VML technology.
Stars: ✭ 937 (+783.96%)
Mutual labels:  svg, javascript-library
Jcanvas
A jQuery plugin that makes the HTML5 canvas easy to work with.
Stars: ✭ 612 (+477.36%)
Mutual labels:  canvas, javascript-library
Calendar Graph
Calendar graph like github using jsx support SVG, Canvas and SSR
Stars: ✭ 58 (-45.28%)
Mutual labels:  svg, canvas
People You Should Follow On Codepen
People You Should Follow on CodePen
Stars: ✭ 542 (+411.32%)
Mutual labels:  svg, canvas
Wind Js
An demo animation of wind on a Canvas layer in the JSAPI
Stars: ✭ 548 (+416.98%)
Mutual labels:  canvas, javascript-library
Deep Viz
A React component library, providing concise and beautiful diversity charts with Canvas, SVG, E-map, WebGL, Dom, based on data visualization experience and commercial data display practice.
Stars: ✭ 55 (-48.11%)
Mutual labels:  svg, canvas
Taro
A lightweight 3D game engine for the web.
Stars: ✭ 345 (+225.47%)
Mutual labels:  svg, canvas
Pasition
Path Transition with little JS code, render to anywhere - 轻量级 Path 过渡库,渲染到任何地方
Stars: ✭ 1,149 (+983.96%)
Mutual labels:  svg, canvas
Nivo
nivo provides a rich set of dataviz components, built on top of the awesome d3 and React libraries
Stars: ✭ 9,550 (+8909.43%)
Mutual labels:  svg, canvas
Ditherjs
A javascript library which dithers an <img> using a fixed palette
Stars: ✭ 76 (-28.3%)
Mutual labels:  canvas, javascript-library
Zrender
A lightweight graphic library providing 2d draw for Apache ECharts
Stars: ✭ 5,122 (+4732.08%)
Mutual labels:  svg, canvas
Pts
A library for visualization and creative-coding
Stars: ✭ 4,628 (+4266.04%)
Mutual labels:  svg, canvas
Html To Image
✂️ Generates an image from a DOM node using HTML5 canvas and SVG.
Stars: ✭ 595 (+461.32%)
Mutual labels:  svg, canvas
Cheetah Grid
The fastest open-source data table for web.
Stars: ✭ 417 (+293.4%)
Mutual labels:  canvas, javascript-library
Svg World Map
🗺 A JavaScript library to easily integrate one or more SVG world maps with all nations (countries) and second-level political subdivisions (countries, provinces, states).
Stars: ✭ 38 (-64.15%)
Mutual labels:  svg, javascript-library
Vega
A visualization grammar.
Stars: ✭ 9,554 (+8913.21%)
Mutual labels:  svg, canvas
Canvg
Javascript SVG parser and renderer on Canvas
Stars: ✭ 2,963 (+2695.28%)
Mutual labels:  svg, canvas
Easycanvas
数据驱动、2D&3D、渐进式Canvas库,支持JSX,配备Chrome调试插件,支持微信小游戏、物理引擎等。
Stars: ✭ 281 (+165.09%)
Mutual labels:  canvas, javascript-library
Zdog
Flat, round, designer-friendly pseudo-3D engine for canvas & SVG
Stars: ✭ 8,904 (+8300%)
Mutual labels:  svg, canvas

reimg

reimg - A javascript library for converting image formats This can convert :

  • svg -> base64
  • svg -> canvas
  • svg -> html <img/> element
  • svg -> png
  • canvas -> base64
  • canvas -> html <img/> element
  • canvas -> png

I needed to do this transformations a few times in the past, and got tired of looking them up.
Most of the solutions I found were either more complicated, or they required heavy 3rd party libraries or frameworks.
This is a very lightweight solution, and very simple to follow.


Just include this library in your html code :

<script src="reimg.js"></script>



Here are some examples on how to use it :

// convert svg element to img element
var img = ReImg.fromSvg(document.querySelector('svg')).toImg();
// now 'img' is the img element created

// convert svg element to png
var png = ReImg.fromSvg(document.getElementById('svg-element-id')).toPng();

// force client download of svg as png image
ReImg.fromSvg(document.querySelector('svg')).downloadPng();

// convert canvas to png
var png = ReImg.fromCanvas(document.getElementById('canvasId')).toPng();



License

This piece of software is issued under the MIT license. You can view the license here

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].