trim-image-dataurldeprecated

A TypeScript function to remove transparent pixels from the borders of images

Usage no npm install needed!

<script type="module">
  import trimImageDataurl from 'https://cdn.skypack.dev/trim-image-dataurl';
</script>

README

trim-image-dataurl

trim-image-dataurl is a TypeScript function to remove transparent pixels from the borders of images

Installation

npm

npm install trim-image-dataurl

Yarn

yarn add trim-image-dataurl

Usage

import trimImage from 'trim-image-dataurl';

const imageElement = document.getElementsByTagName('img')[0];
const trimmedImageDataURL = trimImage(imageElement);
imageElement.src = trimmedImageDataURL;

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT