Files
alrahma_sunday_school/vendor/mike42/gfx-php/test/io/read.php
T
2026-02-10 22:11:06 -05:00

16 lines
387 B
PHP

<?php
// Read an image file,
require_once("../../vendor/autoload.php");
use Mike42\GfxPhp\Image;
if(!isset($argv[1])) {
die("Usage " . $argv[0] . " IMAGE\n");
}
$filename = $argv[1];
$outp = basename($filename, '.png');
echo "Opening file $filename\n";
$img = Image::fromFile($filename);
$img -> write('out/' . $outp . ".ppm");
echo $img -> toBlackAndWhite() -> toString() . "\n";