Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Latest commit

 

History

History
29 lines (15 loc) · 564 Bytes

README.md

File metadata and controls

29 lines (15 loc) · 564 Bytes

SwiftMagickWand

MagickWand(ImageMagick) wrapper for Swift

Sample

import SwiftMagickWand

Wand.genesis()

// https://en.wikipedia.org/wiki/Pikachu
let inputImage = NSData(contentsOfFile: "025Pikachu.png")!

let inputBytes = Array(UnsafeBufferPointer(start: UnsafePointer<UInt8>(inputImage.bytes), count: inputImage.length))

let wand = Wand(imageBytes: inputBytes)

wand.resize(80, h: 80)

let out = wand.getImageBytes()

let outData = NSData(bytes: out, length: out.count)

outData.writeToFile("/tmp/pikachu_resized.png", atomically: false)