Skip to content

Client-side package that provides a simple and easy-to-use interface for resizing and converting images between different MIME types.

Notifications You must be signed in to change notification settings

cristiantela/rck-image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

📦 Rck Image

This is a client-side package that provides a simple and easy-to-use interface for resizing and converting images between different MIME types.

Installation

To install the package, use npm:

npm install rck-image

Usage

To use the package, import it in your application:

import RckImage from "rck-image";

Resizing Images

To resize an image, use the resize method:

// resizes minor dimension to 144 pixels
await RckImage("imageUrlOrFile").resize({ size: 144 }).dataURL();

Converting Image MIME Types

To convert an image to a different MIME type, use the type property:

// gets image in jpeg type and quality of 100%
await RckImage("imageUrlOrFile")
  .resize({ size: 144 })
  // you can use the dataURL function to get the url or you can use the file function to get the File instance
  .dataURL({ type: "image/jpeg", quality: 1 });

Contributing

If you'd like to contribute to the development of this package, please fork the repository and submit a pull request.

About

Client-side package that provides a simple and easy-to-use interface for resizing and converting images between different MIME types.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published