All Projects → randy408 → Libspng

randy408 / Libspng

Licence: bsd-2-clause
Simple, modern libpng alternative

Programming Languages

c
50402 projects - #5 most used programming language
c99
33 projects

Projects that are alternatives of or similar to Libspng

Ffmpeg Video Player
An FFmpeg and SDL Tutorial.
Stars: ✭ 149 (-43.77%)
Mutual labels:  cmake, decoding
Fast ber
A C++11 ASN.1 BER Encoding and Decoding Library
Stars: ✭ 54 (-79.62%)
Mutual labels:  cmake, decoding
Stegify
🔍 Go tool for LSB steganography, capable of hiding any file within an image.
Stars: ✭ 927 (+249.81%)
Mutual labels:  decoding, png
Rawspeed
fast raw decoding library
Stars: ✭ 179 (-32.45%)
Mutual labels:  cmake, decoding
Php Svg
Vector graphics (SVG) library for PHP
Stars: ✭ 256 (-3.4%)
Mutual labels:  png
FindICU.cmake
[CMake] [BSD-2] CMake module to find ICU
Stars: ✭ 28 (-89.43%)
Mutual labels:  cmake
computer-vision-dojo
This is a repository to learn and get more computer vision skills, make robotics projects integrating the computer vision as a perception tool and create a lot of awesome advanced controllers for the robots of the future.
Stars: ✭ 15 (-94.34%)
Mutual labels:  cmake
zigimg
Zig library for reading and writing different image formats
Stars: ✭ 112 (-57.74%)
Mutual labels:  png
Deck
Slide Decks
Stars: ✭ 261 (-1.51%)
Mutual labels:  png
Cppprojecttemplate
Basic, but working, C++ project using CMake, boost and Doxygen
Stars: ✭ 259 (-2.26%)
Mutual labels:  cmake
BunnyLOD
Cross platform GLFW based port of Stan Melax's BunnyLOD Easy Mesh Simplification
Stars: ✭ 60 (-77.36%)
Mutual labels:  cmake
c-template
Boilerplate to set up a c project, include CuTest unit testing, cmake build setup
Stars: ✭ 69 (-73.96%)
Mutual labels:  cmake
Vanilla Rtb
Real Time Bidding (RTB) - Demand Side Platform framework
Stars: ✭ 257 (-3.02%)
Mutual labels:  cmake
cmake-maven-project
Project to enable using CMake from a Maven build.
Stars: ✭ 57 (-78.49%)
Mutual labels:  cmake
Learningdirectx12
This repository is intended to be used as a code repository for learning DirectX 12.
Stars: ✭ 256 (-3.4%)
Mutual labels:  cmake
mapbox-gl-export
This module adds print control to mapbox-gl.
Stars: ✭ 45 (-83.02%)
Mutual labels:  png
cmake-modules
CMake module collection
Stars: ✭ 30 (-88.68%)
Mutual labels:  cmake
Mega Doodles Pack
🔥 Big vector pack with hand-drawn doodles for presentations, social media, blog posts and so on
Stars: ✭ 258 (-2.64%)
Mutual labels:  png
cuda-cmake-gtest-gbench-starter
A cross-platform CUDA/C++14 starter project with google test and google benchmark support.
Stars: ✭ 24 (-90.94%)
Mutual labels:  cmake
CLUSEK-RT
Vulkan based C++ ray-tracing game engine.
Stars: ✭ 24 (-90.94%)
Mutual labels:  cmake

Gitter Financial Contributors on Open Collective GitLab CI Fuzzing Status Coverity coverage tag

libspng

libspng (simple png) is a C library for reading and writing Portable Network Graphics (PNG) format files with a focus on security and ease of use.

libspng is an alternative to libpng, the projects are separate and the APIs are not compatible.

Motivation

The goal is to provide a fast PNG library with a simpler API than libpng, it outperforms the reference implementation in common use cases.

Performance

Features

Feature spng libpng stb_image lodepng
Decode from stream
Gamma correction
No known security bugs[1]
Progressive image read
Parses all standard chunks
Doesn't require zlib[2]
Encoding Planned
Animated PNG Planned [3]

[1] The project is fuzz tested on OSS-Fuzz and vulnerabilities are fixed before they become public.

[2] Building with miniz is supported.

[3] With a 3rd party patch

Getting spng

Download the latest release and include spng.c/spng.h in your project, you can also build with CMake or Meson, refer to the documentation for details.

Usage

#include <spng.h>

/* Create a context */
spng_ctx *ctx = spng_ctx_new(0);

/* Set an input buffer */
spng_set_png_buffer(ctx, buf, buf_size);

/* Determine output image size */
spng_decoded_image_size(ctx, SPNG_FMT_RGBA8, &out_size);

/* Decode to 8-bit RGBA */
spng_decode_image(ctx, out, out_size, SPNG_FMT_RGBA8, 0);

/* Free context memory */
spng_ctx_free(ctx);

See example.c.

License

Code is licensed under the BSD 2-clause "Simplified" License.

The project contains optimizations and test images from libpng, these are licensed under the PNG Reference Library License version 2.

Security & Testing

Code is written according to the rules of the CERT C Coding Standard. All integer arithmetic is checked for overflow and all error conditions are handled gracefully.

The library is continuously fuzzed by OSS-Fuzz, code is also scanned with Clang Static Analyzer, Coverity Scan and PVS-Studio.

The test suite consists of over 1000 test cases, 175 test images are decoded with all possible output format and flag combinations and compared against libpng for correctness.

Versioning

Releases follow the semantic versioning scheme with additional guarantees:

  • Releases from 0.4.0 to 0.8.x are stable
  • If 1.0.0 will introduce breaking changes then 0.8.x will be maintained as a separate stable branch

Currently 1.0.0 is planned to be compatible.

Documentation

Online documentation is available at libspng.org/docs.

Known Issues

  • Decoding to SPNG_FMT_G8, SPNG_FMT_GA8 and SPNG_FMT_GA16 output formats is not supported for all PNG color type and bit depth combinations, see documentation for details.
  • Gamma correction is not implemented for SPNG_FMT_PNG, SPNG_FMT_G8, SPNG_FMT_GA8 and SPNG_FMT_GA16 output formats.
  • Non-critical errors may cause an image to not load (#132).

Supporting spng

You can sponsor development through OpenCollective, funds will be used for maintenance and further development according to the roadmap.

OpenCollective backers

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].