img-io is a lightweight JavaScript library for image processing, specifically designed for image compression and format conversion in browser environments.
- Image compression
- Supports .HEIC (moderm phone photo fromat) to JPEG conversion automatically
- Simple and easy-to-use API
As img-io is not currently published on npm, you need to install it directly from GitHub.
npm install git+https://github.com/vinciarts/img-io.git
import { ImgSelector } from 'img-io';
acceptedTypes
: Array of accepted image typesmaxSize
: Maximum file size in bytestimeout
: Processing timeout in milliseconds
select(file: File): Promise<void>
: Process the selected fileclear(): void
: Clear the current processing result
output
: Object containing the processing resultjpg
: Processed JPEG fileurl
: Preview URL of the processed image
Issues and pull requests are welcome to help improve this project.