# image-to-blob

> a small util to convert image urls to blobs

Latest version **0.2.0** (published 2015-01-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install image-to-blob
pnpm add image-to-blob
yarn add image-to-blob
bun add image-to-blob
```

## Health

**Score 5/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2015-01-03 |
| First published | 2014-12-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jacob Lowe |
| Maintainers | jcblw |

## Links

- npm: https://www.npmjs.com/package/image-to-blob
- Repository: http://github.com/honeinc/image-to-blob
- Homepage: https://github.com/honeinc/image-to-blob
- Issues: https://github.com/honeinc/image-to-blob/issues
- npm.io page: https://npm.io/package/image-to-blob

## Dependencies (1)

- [image-to-data-uri](https://npm.io/package/image-to-data-uri.md) git+https://github.com/jcblw/image-to-data-uri.js

## Recent versions

- 0.2.0 (latest) — 2015-01-03
- 0.1.0 — 2014-12-19
- 0.0.1 — 2014-12-19

## README

# Image to Blob [![Build Status](https://travis-ci.org/jcblw/image-to-blob.svg?branch=master)](https://travis-ci.org/jcblw/image-to-blob)

Image to Blob is a simple utility that will convert images to blobs this can be used for urls to images, that are not cross domain, and IMG DOM node. Its intended to be used with [Browserify](http://browserify.org).

## Install

    $ npm install image-to-blob

## Example Usage

```javascript
var imageToBlob = require( 'image-to-blob' ),
    foo = document.getElementById( 'foo' ),
    DOMURL = window.URL || window.webkitURL || window;

function appendBlob( err, blob ) {
    if ( err ) {
        console.error( err );
        return;
    }

    console.log( blob );
    var img = document.createElement( 'img' );
    img.src = DOMURL.createObjectURL( blob );
    document.body.appendChild( img );    
}

imageToBlob( foo, appendBlob );
imageToBlob( './bar.svg', appendBlob );
```

> This will convert SVG images to pngs.

---
_Source: https://npm.io/package/image-to-blob · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
