readim

Universal Image File Reader. In the Browser, uses read-pixels. In NodeJS, uses jpeg-js or pngjs.

Usage no npm install needed!

<script type="module">
  import readim from 'https://cdn.skypack.dev/readim';
</script>

README

readim

Universal Image File Reader. In the Browser, uses read-pixels. In NodeJS, uses jpeg-js or pngjs.

install

npm install readim

usage in the browser / frontend

import readim from 'readim';

const result = readim({ data: arrayBuffer });
// result is { height: 200, width: 100, pixels: [[[]]] }

usage in NodeJS / backend

const readim = require("readim");

const result = readim({ data: buffer });
// result is { height: 200, width: 100, pixels: [[[]]] }