GithubHelp home page GithubHelp logo

swift-qoi's Introduction

Swift-QOI

Swift implementation of the QOI Format. Contains extensions for AppKit and UIKit to integrate into your projects with ease.

Documentation

// Convert a UIImage/NSImage/CIImage to QOI Data
let image = UIImage(named: "ExamplePNG")!
let encoded = QOICoder.convert(from: image) // Returns Data

// Load a QOI Image from Data to UIImage/NSImage/CIImage
let imageURL = Bundle.main.url(forResource: "TestImage", withExtension: "qoi")!
let data = try! Data(contentsOf: imageURL)

// UIImage
let uiImage = UIImage(qoiData: data)
// or // 
let uiImage = UIImage(qoiURL: imageURL)

// NSImage
let nsImage = NSImage(qoiData: data) 
// or // 
let nsImage = NSImage(qoiURL: imageURL)

// CIImage 
let ciImage = QOICoder.decode(from: data)

License

  • Swift-QOI is licensed under MIT
  • qoi.h is licensed under MIT

swift-qoi's People

Contributors

elihwyma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

swift-qoi's Issues

Compress from UIImage

I get an error like this when I try to compress UIImage to QIO Data. What happened to me? I just follow Example.

Screenshot 2024-03-21 at 23 53 13

Environment
xCode Version: Version 15.2 (15C500b)
iOS: 17.2
swift-driver version: 1.87.3 Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)
Target: arm64-apple-macosx14.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.