bdh777psu/SwiftyImageConverter
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
.leastLicense
SwiftyImageConverter is available under the MIT license.
Package Metadata
Repository: bdh777psu/SwiftyImageConverter
Stars: 0
Forks: 0
Open issues: 0
Default branch: main
Primary language: swift
License: MIT
README: README.md