1.0.4 • Published 2 months ago

react-remove-transparent-bg v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

react-remove-transparent-bg

The Image Background Remover is a lightweight package designed to resize images by removing the transparent parts from an image. This utility is particularly useful for processing images where you want to focus on the main content without the surrounding transparent space, optimizing the image for better use in web and application development.

This functionality is particularly useful for processing images for e-commerce platforms, design applications, or any web-based project .

Installation

To add this package to your project, execute the following command in your terminal:

npm i react-remove-transparent-bg

Usage

First, import the necessary functions from the package in your React component:

import removeTransparentBackground from 'react-remove-transparent-bg';

use removeTransparentBackground function

const [imageFile, setImageFile] = useState<File>()
const formData = new FormData();

//-- Using formik
const image =await removeTransparentBackground(values.image as unknown as File)
formData.append('image', image);

//-- Using useState
const image = await removeTransparentBackground(imageFile as File);
formData.append('image', image);

Complementing Package for Image Compression

To complement the functionality of the Image Background Remover, consider using @mbs-dev/react-image-compressor, an efficient package for compressing images within React JS applications.

npm Package URL: https://www.npmjs.com/package/@mbs-dev/react-image-compressor

Description: The @mbs-dev/react-image-compressor package offers a robust solution for reducing the file size of images without compromising quality. It's designed specifically for React applications, making it a seamless addition to your project alongside the Image Background Remover.

1.0.4

2 months ago

1.2.0

8 months ago

1.1.0

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago

1.1.1

8 months ago