From a48970df0c4bf4d7d106bfa77149c5774e696ff4 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Mon, 26 May 2008 23:14:51 +0200 Subject: [PATCH] Yet more hacks to get the PNG file size down. This time, drop the alpha channel forcibly. --- perl/Sesse/pr0n/Common.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/perl/Sesse/pr0n/Common.pm b/perl/Sesse/pr0n/Common.pm index c441d67..cc2b660 100644 --- a/perl/Sesse/pr0n/Common.pm +++ b/perl/Sesse/pr0n/Common.pm @@ -576,6 +576,11 @@ sub ensure_cached { my $info = Image::ExifTool::ImageInfo($fname); if (make_infobox($img, $info, $r)) { $img->Quantize(colors=>16, dither=>'False'); + + # Since the image is grayscale, ImageMagick overrides us and writes this + # as grayscale anyway, but at least we get rid of the alpha channel this + # way. + $img->Set(type=>'Palette'); } else { # Not enough room for the text, make a tiny dummy transparent infobox @$img = (); -- 2.39.2