Skip to main content

Python package to read a BMP file's header and pixel array in binary.

Project description

Py BMP

Python package to read a BMP file's header and pixel array in binary.

Install Instructions

pip install pybmp2

Usage

from pybmp2 import BMP

img = BMP(filename="sample.bmp")

print(img.SHAPE)
print(img.PIXELARRAY)
print(img.RAWIMGSIZE)
from pybmp import BMP
import binascii
f = open('samp.bmp','rb')
content = f.read()
content = binascii.hexlify(content)
img = BMP(hexdata=hexdata)

print(img.SHAPE)
print(img.PIXELARRAY)
print(img.RAWIMGSIZE)

Refer: https://en.wikipedia.org/wiki/BMP_file_format

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pybmp2-1.0.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

pybmp2-1.0-py3-none-any.whl (3.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page