Skip to main content

fast RGB image pixel format conversion module written in C

Project description


rgbconv - Fast RGB image pixel format conversion module written in C


This manual page documents rgbconv module, a Python module for rapidly converting image pixel format from BGRA (Blue, Green, Red, and Alpha) to RGBA (Red, Green, Blue, and Alpha).

Different aplications/modules use different pixel formats for represenging pixels in images and photos. One of the most popular formats are 24-bit RGB (8 bits each for red, green, and blue) and 32-bit RGBA (8 bits each for red, green, blue, alpha). Other formats include 32-bit BGRA (8 bits for blue, green, red, and alpha) and 32-bit RGBX (8bits for red, gree, blue, and unused).

rgbconv provides bgra2rgba, which rapidly converts from the BGRA format to the RGBA format. rgbconv is implemented in C language for achieving the almost optimal performance.


import rgbconv

img = b'01234567890abcdef'


rgbconv directly modifies a byte-like object in Python for the maximal performance even if the object is immutable, which may cause problems. Use rgbconv module with caution.


pip3 install rgbconv


The latest version of rgbconv module is available at PyPI ( .



Hiroyuki Ohsaki <ohsaki[atmark]>

Project details

Download files

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

Files for rgbconv, version 1.1
Filename, size File type Python version Upload date Hashes
Filename, size rgbconv-1.1-py3.7-linux-x86_64.egg (16.3 kB) File type Egg Python version 3.7 Upload date Hashes View
Filename, size rgbconv-1.1.tar.gz (2.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page