Skip to content

oleh-exe/image-morse-codec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Image Morse Codec

PHP Version PHP GD Extension License Stand with Ukraine Made in Ukraine

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.

⚠️ Warning: Processing large images may require a lot of RAM!


✨ Features

  • ⚑ Lightweight & fast
  • 🧩 Simple API β€” just two methods: toMorse() and fromMorse()
  • πŸ”„ Bidirectional β€” convert images β†’ text and text β†’ images
  • 🎨 Supports PNG and JPEG (JPG)

⚑ Requirements

  • PHP >= 8.2
  • PHP GD extension enabled

πŸ“– Usage

Encode image β†’ Morse

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

Decode Morse β†’ image

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

πŸ‘¨β€πŸ’» Author


πŸ“œ License

Apache 2.0

About

Turn images into Morse code and back! πŸ“‘βœ¨ This PHP library encodes every pixel of a PNG or JPEG image into Morse code and stores it in a text file β€” and can perfectly reconstruct the image from it.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages