Got it working; need to figure out CPAN build of Image::Magick

This commit is contained in:
swaggboi 2025-02-12 17:48:21 -05:00
parent bfca681ee5
commit d0b352492e
3 changed files with 28 additions and 0 deletions

View File

@ -4,3 +4,13 @@ Various experiments to convert image files to avif
## Debian dependencies
- libmagickcore-6-headers: /usr/include/ImageMagick-6/magick/MagickCore.h
## Running it
./image_magick/to_avif.pl images/me.png >> me.avif
## TODOs
- Debian build from CPAN fails, can't find MagickCore.h
- Install `libimage-magick-perl` for now

18
image_magick/to_avif.pl Normal file → Executable file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env perl
use v5.36;
use Image::Magick;
unless ($ARGV[0]) {
say "give me image file, e.g.: $0 goatse.jpeg";
exit 64;
}
my $p = Image::Magick->new;
my $file = $ARGV[0];
$p->Read($file);
# Write to STDOUT instead of file
binmode STDOUT;
$p->Write('avif:-');

BIN
images/me.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 KiB