PHPackages                             ecourtial/php-bmp-parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. ecourtial/php-bmp-parser

ActiveLibrary

ecourtial/php-bmp-parser
========================

A library to parse Windows Bitmap files

0.2.1(4y ago)027MITPHPPHP &gt;=7.4

Since Feb 10Pushed 4y ago1 watchersCompare

[ Source](https://github.com/ecourtial/php-bmp-parser)[ Packagist](https://packagist.org/packages/ecourtial/php-bmp-parser)[ RSS](/packages/ecourtial-php-bmp-parser/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (3)Dependencies (8)Versions (4)Used By (0)

PHP BMP Parser
==============

[](#php-bmp-parser)

[![CircleCI](https://camo.githubusercontent.com/2ece1405060081f36d4503cc757e2b1d1dda9047079ca1ac829d2642bfc089ab/68747470733a2f2f636972636c6563692e636f6d2f67682f65636f75727469616c2f7068702d626d702d7061727365722f747265652f6d61737465722e7376673f7374796c653d737667)](https://circleci.com/gh/ecourtial/php-bmp-parser/tree/master)[![Version](https://camo.githubusercontent.com/1b7e6a074fa62eab65ccb70e376f28783d968d91dce4ec7879b449802d6a62d1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f65636f75727469616c2f7068702d626d702d706172736572)](https://circleci.com/gh/ecourtial/php-bmp-parser/tree/master)[![codecov](https://camo.githubusercontent.com/85c7bcdb12595219c9440c8c9249a83f3e2192644956fa78b7a115b4657ce164/68747470733a2f2f636f6465636f762e696f2f67682f65636f75727469616c2f7068702d626d702d7061727365722f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/ecourtial/php-bmp-parser)[![Infection MSI](https://camo.githubusercontent.com/673b36baf3b33bcbef2a0b75a93586a92382f3e3ede815c7cf51baea2eaeaece/68747470733a2f2f62616467652e737472796b65722d6d757461746f722e696f2f6769746875622e636f6d2f65636f75727469616c2f7068702d626d702d7061727365722f6d6173746572)](https://infection.github.io)[![Maintenance](https://camo.githubusercontent.com/5ca62441414bacaa54c6c6e5b68e46c76305947b6bf498c4949fc71c1b4b10dd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d61696e7461696e65642533462d7965732d677265656e2e737667)](https://GitHub.com/ecourtial/php-bmp-parser/graphs/commit-activity)[![Ask Me Anything !](https://camo.githubusercontent.com/f58000eb7d904f735fbbca30835a588c716bdde0781156f1fb2e601d44307a3a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f41736b2532306d652d616e797468696e672d3161626339632e737667)](https://GitHub.com/ecourtial/php-bmp-parser)[![GitHub license](https://camo.githubusercontent.com/ad07d3fa4aad0c9df5564a9a572bd3b7ea234af5e31f94abab8477c70f5751ed/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f65636f75727469616c2f7068702d626d702d706172736572)](https://github.com/ecourtial/php-bmp-parser/blob/master/LICENSE)[![PHP Version](https://camo.githubusercontent.com/216f803c747e7166dafe2e93cd63f7c3e25a17b6484dca4a6a73593984e4a03a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f65636f75727469616c2f7068702d626d702d706172736572)](https://camo.githubusercontent.com/216f803c747e7166dafe2e93cd63f7c3e25a17b6484dca4a6a73593984e4a03a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f65636f75727469616c2f7068702d626d702d706172736572)

Description
-----------

[](#description)

- This small library allows you to parse a standard Windows BMP file (generic information + pixel by pixel).
- No third party libraries required. It is only based on native PHP functions.
- It also provides a basic feature to edit an existing BMP file (for this feature you will need the *gd* PHP extension).

Limitations
-----------

[](#limitations)

So far the library only handles the following files:

- 24 bits (true colors)
- 8 bits (256 colors) with palette
- 4 bits (16 colors) with palette

Another limitation, when editing: the current version of the library only allows editing 24 bits files.

Installation
------------

[](#installation)

`composer require ecourtial/php-bmp-parser`

Utilization
-----------

[](#utilization)

```
$service = new BmpService();
$image = $service->getImage('myBmpFile.bmp');

// Get a pixel object, with specific coordinates. I am able to check the RGB and hex values.
$image->getPixel(2, 0);

// Now I want to edit the file and change the path to not alter the original one
$image->setPath('myNewBmpFile.bmp);

// Change the color of one specific pixel
$image->getPixel(0, 1)->setR(0)->setG(0)->setB(126);

// Change the size of the image (extra pixels filled with white).
$image->setDimensions(3, 4);

// Change the color of some pixels added because we increased the width.
$image->getPixel(0, 3)->setR(200)->setG(0)->setB(200);
$image->getPixel(1, 3)->setR(0)->setG(0)->setB(255);

// The image object is reloaded on update
$image = $service->update($image);

```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~194 days

Total

3

Last Release

1532d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/445701bfeba046b70c32aee82afb736428e9eadb572d127dacf93bf8dcae3149?d=identicon)[ecourtial](/maintainers/ecourtial)

---

Top Contributors

[![ecourtial](https://avatars.githubusercontent.com/u/57905107?v=4)](https://github.com/ecourtial "ecourtial (5 commits)")

---

Tags

phpBMP

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ecourtial-php-bmp-parser/health.svg)

```
[![Health](https://phpackages.com/badges/ecourtial-php-bmp-parser/health.svg)](https://phpackages.com/packages/ecourtial-php-bmp-parser)
```

###  Alternatives

[pestphp/pest-plugin-stressless

Stressless plugin for Pest

67792.6k16](/packages/pestphp-pest-plugin-stressless)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
