New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pyspng

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pyspng

Fast libspng-based PNG decoder

  • 0.1.2
  • PyPI
  • Socket score

Maintainers
1

Pyspng is a small library to for efficiently loading PNG files to numpy arrays. Pyspng does not offer any image manipulation functionality.

Pyspng was originally written to speed up loading uncompressed (PNG compression level 0), making the PNG file format more suitable to be used in machine learning datasets. Pyspng uses the native libspng library for fast PNG decoding. Synthetic benchmarks indicate pyspng to be roughly 2-3x faster in loading uncompressed PNGs than the Python Pillow library.

Example

import numpy as np
import pyspng

with open('test.png', 'rb') as fin:
    nparr = pyspng.load(fin.read())

Installation

pip install pyspng

Note: binary wheels are built for Linux and Windows. MacOS may not work out of the box.

Local Development

  1. Clone the git repo
  2. cd pyspng && pip install .

License

pyspng is provided under a BSD-style license that can be found in the LICENSE file. By using, distributing, or contributing to this project, you agree to the terms and conditions of this license.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc