1.0.0 ⢠Published 5 months ago
convertify-image v1.0.0
Convertify Image
š A Powerful TypeScript Library for Image Conversion
Convertify Image is a lightweight and powerful TypeScript library for converting images between multiple formats using Base64 encoding and ImageMagick.
š¦ Installation
Using pnpm:
pnpm add convertify-image
Using npm:
npm install convertify-image
Using yarn:
yarn add convertify-image
š§ Requirements
Before using Convertify Image, ensure you have ImageMagick installed on your system.
Linux (Ubuntu/Debian)
sudo apt update && sudo apt install -y imagemagick libopenjp2-7 ghostscript
macOS
brew install imagemagick
Windows
Download and install ImageMagick from: ImageMagick Official Site
š Usage
1ļøā£ Check if ImageMagick is Installed and Install if Necessary
import { ConvertifyImage } from '../src/Convertify'
const converter = new ConvertifyImage()
converter.checkImageMagick().then((isInstalled) => {
if (!isInstalled) {
console.log('Installing ImageMagick...')
converter
.installImageMagick()
.then(() => console.log('Installation complete!'))
.catch((error) => console.error('Installation failed:', error))
}
})
2ļøā£ Convert Image File to Base64 and Convert to Another Format
const imagePath = '50239.jpg'
const outputFormat = 'jp2'
converter
.imageToBase64(imagePath)
.then((base64Image) => {
console.log('Base64 Image:', base64Image)
// Now use it for conversion
return converter.convertBase64(base64Image, outputFormat)
})
.then((convertedBase64) => {
console.log(convertedBase64)
console.log('Converted Image (Base64):')
})
.catch((error) => {
console.error('Error:', error)
})
šÆ Features
ā
Convert between multiple formats: PNG, JPG, GIF, WEBP, TIFF, JP2, BMP, HEIC
ā
Supports Base64 encoding and decoding
ā
Uses ImageMagick for high-quality image transformations
š ļø Development & Contribution
Clone the Repository
git clone https://github.com/your-username/convertify-image.git
cd convertify-image
Install Dependencies
pnpm install
Run Tests
pnpm test
Build the Project
pnpm build
Format & Lint Code
pnpm format && pnpm lint
š License
MIT License Ā© 2025 - Gabriel Mata
š Connect with Us
š¬ GitHub Issues - Report bugs and suggest features
1.0.0
5 months ago