Single File Assets is a file storage format for images

Related tags

Command-line sfa
Overview

SFA (Rust)

Single File Assets is a file storage format for images. The packed images are not guaranteed to be of same format because the format while saving is changed to png which is lossless. So expectation of jpeg image being extracted from a sfa file being same does not work.

Example

You can use it to make a spritesheet. For example with the following images with us:

  • sprite_1.png
  • sprite_2.png
  • sprite_3.png

we can convert these multiple files into one using the sfa command line utility which can be downloaded from our release page or by simply doing as follows:

cargo install sfa

and then the utility can be used as follows

sfa pack sprite_1.png sprite_2.png sprite_3.png -o sprite.sfa

Now the above generated sfa file can be used in our program

use sfa::decode;
use std::collections::HashMap;

fn main() {
    // Load the file with images in memory (You can skip the type annotations)
    let sprite: HashMap<String, image::DynamicImage> = decode("sprite.sfa").expect("Unexpected error occurred");

    // Now separate images can be accessed with there original name
    let frame_1 = &sprite["sprite_1.png"];
}
You might also like...
A simple command line program to upload file or directory to web3.storage with optional encryption and compression
A simple command line program to upload file or directory to web3.storage with optional encryption and compression

w3s-cli A simple command line program to upload file or directory to web3.storage with optional encryption and compression. Features Uploads single fi

A command line tool for easily generating multiple versions of a configuration file from a single template

MultiConf A command line tool for easily generating multiple versions of a configuration file from a single template. Why? I'm a big fan of the i3 win

Set Shell Environment Variables across multiple shells with a single configuration file.

Xshe – Cross-Shell Environment Vars xshe allows for setting Shell Environment Variables across multiple shells with a single TOML configuration file.

singe's grep - a fast grep using single-file parallelism

singrep singe's grep - a fast grep using single-file parallelism singrep makes use of deterministic kernel file cache'ing to read the file fast enough

CLI application to run clang-format on a set of files specified using globs in a JSON configuration file.
CLI application to run clang-format on a set of files specified using globs in a JSON configuration file.

run_clang_format CLI application for running clang-format for an existing .clang-format file on a set of files, specified using globs in a .json confi

A low-level MVCC file format for storing blobs.

Sediment This repository isn't ready for public consumption. It just reached a stage where I wanted to start sharing ideas with others as well as usin

Blazingly Rapid Uncompressed Harebrained Image File Format.
Blazingly Rapid Uncompressed Harebrained Image File Format.

BRUHIFF Blazingly rapid uncompressed harebrained Image File Format. Also known as BRUHIFF or BRUH. How to Download the repo / git clone it. Open a com

Manage lightweight VMs created from OCI images
Manage lightweight VMs created from OCI images

krunvm krunvm is a CLI-based utility for managing lightweight VMs created from OCI images, using libkrun and buildah. Features Minimal footprint Fast

Command-Line program that takes images and produces the copy of the image with a thin frame and palette made of the 10 most frequent colors.
Command-Line program that takes images and produces the copy of the image with a thin frame and palette made of the 10 most frequent colors.

paleatra v.0.0.1 Command-Line program that takes an image and produces the copy of the image with a thin frame and palette made of the 10 most frequen

Owner
I am a good python programmer, I like contributing to repositories. I work hard for making my API easy to understand.
null
Databento Binary Encoding (DBZ) - Fast message encoding and storage format for market data

dbz A library (dbz-lib) and CLI tool (dbz-cli) for working with Databento Binary Encoding (DBZ) files. Python bindings for dbz-lib are provided in the

Databento, Inc. 15 Nov 4, 2022
An apocalypse-resistant data storage format for the truly paranoid.

Carbonado An apocalypse-resistant data storage format for the truly paranoid. Designed to keep encrypted, durable, compressed, provably replicated con

diba-io 30 Dec 29, 2022
CLI tool that make it easier to perform multiple lighthouse runs towards a single target and output the result in a plotable format.

Lighthouse Aggregator CLI tool that make it easier to perform multiple lighthouse runs towards a single target and output the result in a "plotable" f

Polestar 1 Jan 12, 2022
Given a set of kmers (fasta format) and a set of sequences (fasta format), this tool will extract the sequences containing the kmers.

Kmer2sequences Description Given a set of kmers (fasta / fastq [.gz] format) and a set of sequences (fasta / fastq [.gz] format), this tool will extra

Pierre Peterlongo 22 Sep 16, 2023
My own image file format created for fun! Install the "hif_opener.exe" to open hif files. clone the repo and compile to make your own hif file

Why am i creating this? I wanted to create my own image format since I was 12 years old using Windows 7, tryna modify GTA San Andreas. That day, when

hiftie 3 Dec 17, 2023
Repository containing assets for the Holium CLI tutorial

Welcome to getting-started ?? In this repository you can find all necessary assets for the Holium CLI tutorial ?? Homepage The tutorial that reference

Polyphene 2 Mar 11, 2022
Rust-language assets for Zcash

Zcash Rust crates This repository contains a (work-in-progress) set of Rust crates for working with Zcash. Security Warnings These libraries are curre

Zcash 273 Jan 3, 2023
zigfi is an open-source stocks, commodities and cryptocurrencies price monitoring CLI app, written fully in Rust, where you can organize assets you're watching easily into watchlists for easy access on your terminal.

zigfi zigfi is an open-source stocks, commodities and cryptocurrencies price monitoring CLI app, written fully in Rust, where you can organize assets

Aldrin Zigmund Cortez Velasco 18 Oct 24, 2022
A rust binary that will flip one or more bits of a file (mostly for messing with images for fun).

file-bitflipper A rust binary that will flip one or more bits of a file (mostly for messing with images for fun). Example (bitflipped bentley) Usage $

null 1 Aug 31, 2022
Automatically replace Discord CDN links with local file links, by downloading the images to the public folder

Auto Undiscord Did you hear that Discord will be blocking external websites from using images hosted on their servers? Did you host every image on you

Dot32 5 Nov 17, 2023