public function writeImageHeader($width, $height, $colorType) 
    {
        $this->buffer->startChunk("IHDR");
        $this->buffer->writeUInt32BE($width);
        $this->buffer->writeUInt32BE($height);
        $this->buffer->writeUInt8(8); // Bit depth
        $this->buffer->writeUInt8($colorType);
        $this->buffer->writeUInt8(0); // Compression
        $this->buffer->writeUInt8(0); // Filter
        $this->buffer->writeUInt8(0); // Interlace
        $this->buffer->endChunk();
    }