A texture compression algorithm for sprite sheets that allows decompression on the GPU during rendering.

Overview

CRABBY

A texture compression format for spritesheets

Crabby TL;DR

Crabby is a compressed texture format for spritesheets and flipbook animations.

What is Crabby?

Crabby is an encoder / texture format for creating a compressed sprite sheet with direct-access decompression on the GPU w/o the need for an intermediate texture.

Why is Crabby?

Crabby is a compressed texture format for spritesheets, which allows decompression on the GPU without the need of intermediate decode stages. Other formats like JPG, GIF, and H264 require decodes to intermediate CPU side textures, followed by a required upload to the GPU before they can be used. Crabby works by creating a unique palette of pixel blocks (typically 4x4), and transcodes the original images as a combination of the block palette, and pointers to what block indexes. The savings from crabby come from the fact that most sprites in a spritesheet contain large amounts of of duplicate pixels that can be removed in this process. Crabby itself is designed to work hand-in-hand with other GPU compressed texture formats like ETC, DXT, and PVR to achieve maximum savings.

Who is Crabby For?

Crabby is designed for 2D games which are heavy with flipbook based sprite animations. In it's current form, Crabby is targeted to reuce the size of GPU and distribution residency. As such, it makes certain assumptions about your data set, and how you're going to use textures in your game. Crabby is not built for 3D textures, and currently doesn't support mip-mapping.

What is Crabby's development status?

Crabby represents an ALPHA state of development. If it does not meet your needs, please file an issue for a specific feature, and we will address it.

How does Crabby work?

Crabby works by finding removing duplicate 4x4 blocks of pixels from an atlas image. Spritesheets tend to have lots of blank space, in addition to lots of duplicated color structure. Crabby search all the input textures provided, will list all the unique blocks in a single 'pallete texture' image. For each image provided, Crabby will output a 'frame' texture that references, in raster scan order, what 4x4 pixel block should go there. For more information, you can see a document covering the algorithms in more detail.

What type of compression savings does Crabby provide?

The compression performance of Crabby is based entirely on how much duplicate 4x4 pixel blocks can be removed from a sprite sheet. For some examples, you can view the running results document for a rough idea of what types of images do well with Crabby.

What type of performance hit does Crabby cause?

Pretty well, actually. The largest (potential) bottleneck comes from the dependent texture read. For desktop hardware, this fetch is negligable (webGL, modern desktop ,console GPUs easily eat this up). For mobile hardware, this entirely depends on your GPU. We've seen some performance concerns on older tiling architectures, and low-cost GPUs. results document will contain more benchmark tests as they are run and provided.

How should I use Crabby?

Crabby is best used by providing individual, un-atlased textures to it that share some commonality. Crabby will index, reference, and atlas-pack these loose textures on your behalf, and provide to you all the data you need for the decoder. Technically speaking, Crabby will work on already packed images (you can just pass it an atlas) however the savings in this process will not be as good as the loose textures. The reason for this behavior is straightforward:

  • Charts in atlases have often been rotated, or flipped in order to produce a better atlas packing.
  • Charts in an atlas may not obey alignments in the same way. For example, two 128x128 images will roughly share the same 4x4 blocks. However when they are atlases, one might be shifted by a pixel, meaning that it will have completly unique 4x4 blocks.

The take-away from this is that running Crabby on a single atlas will work, although the savings will not be as great compared to running each chart of the atlas through crabby solo.

Issues
  • Single-image savings are less than their multi-texture counterparts

    Single-image savings are less than their multi-texture counterparts

    If you take a post-combined atlas, and run it through crabby, the color-block-matcher finds less matching blocks than if all the charts of the atlas had been submitted individually. I'm not sure why this is the case just yet, but it needs some investigation.

    bug 
    opened by mainroach 1
  • Need faster block searching function

    Need faster block searching function

    Currently, the block-searching function is a linear search over all existing blocks to find a match. This is obviously slow for large atlases.

    Need to adopt some data structure to allow acceleration of block finding. hash maps, B Trees, etc.

    enhancement 
    opened by mainroach 1
  • create a more compressed disk format

    create a more compressed disk format

    *Take advantage of VLC for block indexes. *add a 2nd layer for per-scanline palettes. (One bit at start of scanline to denote of its palette or inline)

    opened by mainroach 1
  • Crabby only supports point sampling

    Crabby only supports point sampling

    Currently the block sampling method that crabby uses only supports POINT sampling mode for filtering. Some 2D games use filtering everywhere, as part of their art-style. We need to find a way to support this use case.

    opened by mainroach 1
  • Merge The Frames and Metadata data files

    Merge The Frames and Metadata data files

    Our goal is to reduce the number of unique files that must be managed by the developer. Merge these two files into one file in order to accomplish this.

    enhancement 
    opened by mainroach 0
  • Add support to not output frame-packing meta data

    Add support to not output frame-packing meta data

    Some developers want to use Crabby as a post-process to an already atlas packed texture. In this case, they will have the atlas metadata already resident in another form, so it's un-needed to output this data in our format, or do additional binary packing since there's only one input texture.

    enhancement 
    opened by mainroach 0
Owner
Colt McAnlis
Colt McAnlis
This plugin allows Flutter desktop apps to capture screenshots.

screen_capturer This plugin allows Flutter desktop apps to capture screenshots. screen_capturer Platform Support Quick Start Installation Usage Licens

LeanFlutter 35 Jun 21, 2022
Allows a programmer to save/load configurations to/from filesystem in a structured way

fsconfig Allows a programmer to save/load configurations to/from filesystem in a structured way. Groups are mapped into directories, fields are mapped

null 8 Dec 27, 2021
Archive Extension Loader is a Cyberpunk 2077 mod that allows you to expand game resources that are currently not suitable for modifications without conflicts.

ArchiveXL Archive Extension Loader allows you to expand game resources that are currently not suitable for modifications without conflicts. Installati

Pavel Siberx 8 Apr 1, 2022
Allows a programmer to print table-like outputs over std::ostream.

tableprinter Allows a programmer to print table-like outputs over std::ostream. It is a header only library. No other dependency than STL. Provides re

null 25 Apr 15, 2022
SCST is a SCSI target software stack that allows to export any block device or file via iSCSI, FC or RDMA (SRP).

Overview This is the source code repository of the SCST project. SCST is a collection of Linux kernel drivers that implement SCSI target functionality

SCST 17 Jun 8, 2022
A thread-safe, easy-to-use, utility for sending and receiving notifications. It allows you to decouple different modules of your application.

NotificationManager NotificationManager is a thread-safe, easy-to-use utility for sending and receiving notifications. It allows you to decouple diffe

Carlos Aragonés 6 Dec 27, 2021
A flutter plugin that runs a wayland compositor to stream textures onto flutter, allows creation of wayland based shells using flutter

flcompositor A new flutter plugin project. Getting Started This project is a starting point for a Flutter plug-in package, a specialized package that

Davide Bianco 3 Jan 10, 2022
this lib with 26 template container and 10 kinds of algorithm, it is a good lib for study and usage

simple stl this lib simplify the achievement detail of common container, but add the container variety, the whole code partily follow Google Style. Em

wujiazheng 7 Mar 10, 2022
Przemyslaw Skibinski 549 Jun 22, 2022
An experimental sprite rendering setup utilizing SSBO's, Threading, EnTT reactive systems, and array-textures based sprite caching.

entt-reactive An experimental sprite rendering setup utilizing pooled SSBO's, a multithreaded setup based on Even Todd's The Poor Man's Threading Arch

Jackie Fuchs 7 Apr 29, 2022
NVIDIA Texture Tools samples for compression, image processing, and decompression.

NVTT 3 Samples This repository contains a number of samples showing how to use NVTT 3, a GPU-accelerated texture compression and image processing libr

NVIDIA DesignWorks Samples 31 Jun 13, 2022
Lossy fixed-rate GPU-friendly image compression\decompression.

NotOkImageFormat Lossy fixed-rate GPU-friendly image compression\decompression. Supported profiles 16:1:1 2.8125 bpp yuv 4:1:1 3.75 bpp

Boris Batkin 10 Jan 27, 2022
Single source file ASTC texture decompression in C++ (derived from Google's open source Android project)

astc_dec astc_dec is a single source file ASTC texture decompressor with the Apache 2.0 license, derived from Google's open source Android sources. Th

Rich Geldreich 28 Apr 11, 2022
Analysing and implementation of lossless data compression techniques like Huffman encoding and LZW was conducted along with JPEG lossy compression technique based on discrete cosine transform (DCT) for Image compression.

PROJECT FILE COMPRESSION ALGORITHMS - Huffman compression LZW compression DCT Aim of the project - Implement above mentioned compression algorithms an

null 1 Dec 14, 2021
✔️The smallest header-only GUI library(4 KLOC) for all platforms

Welcome to GUI-lite The smallest header-only GUI library (4 KLOC) for all platforms. 中文 Lightweight ✂️ Small: 4,000+ lines of C++ code, zero dependenc

null 6.3k Jun 27, 2022
Lossless data compression codec with LZMA-like ratios but 1.5x-8x faster decompression speed, C/C++

LZHAM - Lossless Data Compression Codec Public Domain (see LICENSE) LZHAM is a lossless data compression codec written in C/C++ (specifically C++03),

Rich Geldreich 626 Jun 15, 2022
Legion Low Level Rendering Interface provides a graphics API agnostic rendering interface with minimal CPU overhead and low level access to verbose GPU operations.

Legion-LLRI Legion-LLRI, or “Legion Low Level Rendering Interface” is a rendering API that aims to provide a graphics API agnostic approach to graphic

Rythe Interactive 25 Mar 8, 2022
Vita Recorder is a plugin that allows to record video clips during your play sessions.

Vita Recorder Vita Recorder is a plugin that allows to record video clips during your play sessions. The code is based off VITA2PC at which has been a

Rinnegatamante 19 Jun 17, 2022
Advanced DXTc texture compression and transcoding library

crunch/crnlib v1.04 - Advanced DXTn texture compression library Public Domain - Please see license.txt. Portions of this software make use of public d

null 743 Jun 19, 2022
Advanced DXTc texture compression and transcoding library

crunch/crnlib v1.04 - Advanced DXTn texture compression library Copyright (C) 2010-2017 Richard Geldreich, Jr. and Binomial LLC http://binomial.info F

Unity Technologies 204 Jun 23, 2022
Distributed (Deep) Machine Learning Community 677 Apr 14, 2022
A collection of individual tools to randomize bdsp sheets

BDSP_Randomisers A collection of tools to randomize BDSP assets Setup (Windows 10 only) Install Ubuntu 18.04 via WSL1 (plenty of tutorials on that) In

null 6 Mar 1, 2022
Fast C/C++ CSS Parser (Cascading Style Sheets Parser)

MyCSS — a pure C CSS parser MyCSS is a fast CSS Parser implemented as a pure C99 library with the ability to build without dependencies. Mailing List:

Alexander 119 Jun 18, 2022
A distribution of the cFS that includes the cfe-eds-framework which includes NASA's core Flight Executive(cFE) and CCSDS Electronic Data Sheets(EDS) support.

core Flight System(cFS) Application Toolkit(cFSAT) - Beta Release A distribution of the cFS that includes the cfe-eds-framework which includes NASA's

OpenSatKit 13 Jun 24, 2022
Shamir’s Secret Sharing Algorithm: Shamir’s Secret Sharing is an algorithm in cryptography created by Adi Shamir. The main aim of this algorithm is to divide secret that needs to be encrypted into various unique parts.

Shamir-s-Secret-Sharing-Algorithm-Cryptography Shamir’s Secret Sharing Algorithm: Shamir’s Secret Sharing is an algorithm in cryptography created by A

Pavan Ananth Sharma 4 Apr 27, 2022
RDO BC1-7 GPU texture encoders

bc7enc - Fast BC1-7 GPU texture encoders with Rate Distortion Optimization (RDO) This repo contains fast texture encoders for BC1-7. All formats suppo

Rich Geldreich 88 Jun 24, 2022
GPU Texture Baking Tool

fornos GPU Texture Baking Tool A fast and simple tool to bake your high-poly mesh details to textures. Bakers Height Position Normals Ambient Occlusio

Oscar Sebio Cajaraville 91 Apr 26, 2022
GPU Texture Generator

Imogen GPU/CPU Texture Generator GPU Texture generator using dear imgui for UI. Not production ready and a bit messy but really fun to code. This is a

Cedric Guillemet 703 Jun 17, 2022