1.0.0 • Published 5 months ago

convertify-image v1.0.0

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

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