定制 ecourtial/php-bmp-parser 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ecourtial/php-bmp-parser

Composer 安装命令:

composer require ecourtial/php-bmp-parser

包简介

A library to parse Windows Bitmap files

关键字:

README 文档

README

CircleCI Version codecov Infection MSI Maintenance Ask Me Anything ! GitHub license PHP Version

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

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

composer require ecourtial/php-bmp-parser

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);

统计信息

  • 总下载量: 27
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-02-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固