@ambush/image v1.1.0
Overview
This library is optimized for speed and resource efficiency but operates synchronously. Please note that synchronous operations may be slower than asynchronous alternatives. When using @ambush/image
in performance-critical scenarios, consider asynchronous execution for optimal speed.
@ambush/image
is a all-in-one, lightweight npm package designed for encoding and decoding various image formats without the need for external dependencies. This library simplifies image processing tasks, supporting popular formats like PNG, JPEG, BMP, and TIFF, offering seamless integration for developers and applications requiring image manipulation.
Key Features
@ambush/image
provides a user-friendly interface to efficiently encode and decode images in multiple formats, ensuring high-quality results.
- PNG (Portable Network Graphics)
- JPEG (Joint Photographic Experts Group)
- BMP (Bitmap Image)
- TIFF (Tagged Image File Format)
Usage
Let's import this library and the fs
library first.
// CJS Modules
const ambushImg = require('@ambush/image');
const fs = require('fs');
// ES Modules
import ambushImg from '@ambush/image';
import fs from 'fs';
Here's a simple code snippet to decode & encode the image and save it using the fs
library.
const imageData = fs.readFileSync('image.png');
const decodedImage = ambushImg.decodeImage(imageData);
const encodedImage = ambushImg.encodeImage(decodedImage);
fs.writeFileSync('output.png', encodedImage.data);
Contributing
We welcome contributions from the community to improve and enhance this project. Whether you're a developer, designer, tester, or have ideas to share, your help is valuable. If you're willing to contribute and get involved, please see the contributing guide file for more details.
We adhere to the Code of Conduct to ensure a respectful and inclusive community. Please review it and follow the guidelines when participating in this project.
If you have any problems, issues or questions please email us at ambush.js.org@gmail.com
License
This project is licensed under the Apache License 2.0.
Copyright © 2023 Ambush, Inc.