SwiftyImageConverter

main

A simple image file to JPEG or PNG data representation conversion utility in Swift.
bdh777psu/SwiftyImageConverter

SwiftyImageConverter

Build Status

A simple image file to JPEG or PNG data representation conversion utility in Swift.

Description

This Swift Package was designed to be a simple utility tool to convert image files to their JPEG or PNG data format equivalents.

Installation

SwiftyImageConverter is available as a Swift Package. To install it, simply add the following line to your 'Package.swift' file:

.package(url: "https://github.com/bdh777psu/SwiftyImageConverter", branch: "main"),

...or drag the 'SwiftyImageConverter.swift' file into your project.

Usage Example

import SwiftyImageConverter

let pathToFile = "/path/file.heic"
let pathToFile1 = "/path/file1.heic"

let pathToFiles = [pathToFile, pathToFile1]

let sicUtil = SwiftImageFileConverter()

let convertedJPEGs: [Data] = sicUtil.convertImageFilesToJpeg(filesPaths: pathToFiles, compression: .maximum)
let convertedPNGs: [Data] = sicUtil.convertImageFilesToPng(filesPaths: pathToFiles)

Available Compression levels

The quality of the resulting JPEG image, expressed as a value from 0.0 to 1.0. The value 0.0 represents the maximum compression (or lowest quality) while the value 1.0 represents the least compression (or best quality).

    .maximum
    .high
    .medium
    .low
    .least

Author

Diogo Lessa

License

SwiftyImageConverter is available under the MIT license.

Description

  • Swift Tools 5.6.0
View More Packages from this Author

Dependencies

  • None
Last updated: Sun Mar 10 2024 22:13:50 GMT-0900 (Hawaii-Aleutian Daylight Time)