Turn images into Morse code β and back again! π‘β¨
Image Morse Codec is a lightweight PHP library that encodes every pixel of a PNG or JPEG image into Morse code and saves it to a text file. You can also decode such files to reconstruct the original image.
- β‘ Lightweight & fast
- π§© Simple API β just two methods:
toMorse()andfromMorse() - π Bidirectional β convert images β text and text β images
- π¨ Supports PNG and JPEG (JPG)
- PHP >= 8.2
- PHP GD extension enabled
<?php
require_once('ImageMorseCodec/ImageMorseCodec.php');
use ImageMorseCodec\ImageMorseCodec;
$codec = new ImageMorseCodec();
// Instead of "example.png", provide the image name or full path
$codec->toMorse('example.png');<?php
require_once('ImageMorseCodec/ImageMorseCodec.php');
use ImageMorseCodec\ImageMorseCodec;
$codec = new ImageMorseCodec();
// Instead of "example.txt", provide the text file name or full path
$codec->fromMorse('example.txt');- Oleh Kovalenko β Owner & Maintainer