nusje2000 / binary-data-processing

A project to learn more about binary file processing and the usage of binary data within PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BMP Implementation

A PHP Based implementation of the BMP File Format.

Motivation

I haven't worked with binary files that much yet and was intrested in learning more about them. Therefore, I've set the goal to implement the BMP file format in PHP.

To challange myself I've decided that the only sources I am allowed to use are php.net and this version of the BMP File Format documentation documentation. The main goal is to be able to read and write bmp images.

Project requirements

To consider this project as done, it must contain the code to do the following:

  1. Read individual pixel values from example.bmp
  2. Be able to display image information, this must include:
    • Height
    • Width
    • Colors
  3. Modify example.bmp, modifications include:
    • Swap the sides of the image (so the left half becomes the right half, and vice versa)
    • Convert the white background to another color
  4. Generate an image, matching specifications:
    • Should contain a square of 100px high
    • The square should have a 5px red border
    • The square should have a green filling
    • The square should be centered in the image
    • The image should be 300px in width
    • The image should be 200px in height

About

A project to learn more about binary file processing and the usage of binary data within PHP


Languages

Language:PHP 100.0%