Small color quantizer for bitmaps without any dependencies or use of frameworks

Overview

MicroColorQuantizer

Swift

This package currently offers a very simple color quantizer for bitmap. It can be used to reduce the number of unique colors used in an image.

It does not rely on any frameworks and should work on all Swift supported platforms.

Example usage

let width = 256
let height = 256

var imageData: [UInt32] = .init(repeating: 0, count: width * height)

var index = 0
for y: UInt32 in 0 ..< 256 {
    for x: UInt32 in 0 ..< 256 {
        imageData[index] = 0xFF000000 | (x << 16) | (y << 8) | (255 - y)

        index += 1
    }
}

let quantizer = MicroColorQuantizer()

let quantizedImageData = quantizer.quantize(bitmap: testImageData, width: width, height: height, maximumNumberOfColors: 256)
You might also like...
An iOS/tvOS photo gallery viewer, useful for viewing a large (or small!) number of photos.
An iOS/tvOS photo gallery viewer, useful for viewing a large (or small!) number of photos.

This project is unmaintained. Alex passed away in an accident in late 2019. His love of iOS development will always be remembered. AXPhotoViewer AXPho

 SwiftGif - A small UIImage extension with gif support.
SwiftGif - A small UIImage extension with gif support.

SwiftGif - A small UIImage extension with gif support.

ZImageCropper is a simplest way to crop image to any shapes you like.
ZImageCropper is a simplest way to crop image to any shapes you like.

ZImageCropper ZImageCropper is a simplest way to crop image to any shapes you like. Example To run the example project, clone the repo, and run pod in

PrettyBorder is a SwiftUI package for managing an customized border and background at any kind of view.
PrettyBorder is a SwiftUI package for managing an customized border and background at any kind of view.

PrettyBorder Description PrettyBorder is a SwiftUI package for managing an customized border and background at any kind of view. Preview of end result

A complete Mac App: drag an image file to the top section and the bottom section will show you the text of any QRCodes in the image.

QRDecode A complete Mac App: drag an image file to the top section and the bottom section will show you the text of any QRCodes in the image. QRDecode

A free, multiplatform SDK for real-time facial motion capture using blendshapes, and rigid head pose in 3D space from any RGB camera, photo, or video.
A free, multiplatform SDK for real-time facial motion capture using blendshapes, and rigid head pose in 3D space from any RGB camera, photo, or video.

mocap4face by Facemoji mocap4face by Facemoji is a free, multiplatform SDK for real-time facial motion capture based on Facial Action Coding System or

iOS Framework that makes it easy to preview images on any UIImageView.
iOS Framework that makes it easy to preview images on any UIImageView.

AZImagePreview iOS Framework that makes it easy to preview images on any UIImageView. Screenshots Installation: Cocoa Pods: pod 'AZImagePreview' Swift

Pipable is an iOS library to implement Picture in Picture for any UIView.
Pipable is an iOS library to implement Picture in Picture for any UIView.

Pipable Pipable is an iOS library to implement Picture in Picture for any UIView. This is done just by conforming to a protocol. The "Audio, AirPlay a

Create an '.icns' file from any image

createicns Create an '.icns' file from any image. Usage This command line tool makes it incredibly simple to create an '.icns' icon file from an image

Owner
Robert Bruinier
Robert Bruinier
Make system color defined in UIColor/NSColor available to SwiftUI Color.

SwiftUIColor Make system color defined in UIColor/NSColor available to SwiftUI Color. About In this library, colors are defined in an asset file. Crea

null 2 Oct 24, 2022
AZS - There are two frameworks in the pod file, you need to install them to work with the project

AZS There are two frameworks in the pod file, you need to install them to work w

Nikita12G 0 Jan 14, 2022
Random image and background color with swift

Random-image-and-background-color Hello, this is my first project. Frankly, I got this idea from the "IOS Academy" page, but: color scale for the back

imhalid 2 Apr 12, 2022
SwiftColorArt is a demo application that includes Swift files with all classes and extension necessary to create a font color schema matching to an image

SwiftColorArt SwiftColorArt is a demo application that includes Swift files with all classes and extension necessary to create a font color schema mat

Jan Gregor Triebel 264 Jan 4, 2023
🎨 Mondrian is lightweight Swift package that provides a universal basis for your design system's color palette.

??‍?? Mondrian Mondrian provides a universal basis on which to build your design system's color palette right from your codebase. With support for all

Klaas Schoenmaker 1 Nov 24, 2021
Cordova plugin to display a native color-picker dialog

Color Picker Plugin for Cordova (cordova-plugin-color-picker) Description This plugin allows you to display a color-picker native dialog in iOS and An

Antonio Vargas 1 May 10, 2022
The first non-jailbroken iOS (and macOS) application to adjust the screen temperature, brightness, and color!

GoodNight Project name thanks to @Emu4iOS. Based off of Thomas Finch's GammaThingy. GoodNight is an app that allows you to directly access the screen'

Anthony Agatiello 558 Nov 3, 2022
XcodeColorSense - An Xcode plugin that makes working with color easier.

XcodeColorSense An Xcode plugin that makes working with color easier. Inspired by ColorSense-for-Xcode with extra care for Hex color Features Show col

Khoa 77 Jul 1, 2022
Globally change the appearance of the application. Light/Dark mode and color.

About I tried to create a project where you can globally change the appearance of the application. Perhaps someone was looking for such a solution. ⭐️

Aleksandr Buiakov 5 Aug 30, 2022
Swiftly convert country codes and cultural terms to all 269 emoji flags without hassle

Swiftly convert country codes and cultural terms to all 269 emoji flags without hassle

Arnold Rozon 2 May 9, 2022