Subject: | Slow RGBA PNG processing performance |
Date: | Wed, 7 Feb 2018 10:34:55 +0000 |
To: | bug-PDF-API2 [...] rt.cpan.org |
From: | Dusan Vuckovic <dusan.vuckovic [...] otrs.com> |
Hello,
I'm having performance issues with RGBA PNG files, when they are
processed by the image_png() method.
I'm supplying two screenshot files as a reproduction sample: one is
plain RGB, the other one has an alpha channel as well.
$ file screenshot-rgb.png
screenshot-rgb.png: PNG image data, 2400 x 1800, 8-bit/color RGB,
non-interlaced
$ time perl -e 'use PDF::API2;
PDF::API2->new()->image_png("screenshot-rgb.png")'
real 0m0.174s
user 0m0.140s
sys 0m0.022s
$ file screenshot-rgba.png
screenshot-rgba.png: PNG image data, 2400 x 1800, 8-bit/color RGBA,
non-interlaced
$time perl -e 'use PDF::API2;
PDF::API2->new()->image_png("screenshot-rgba.png")'
real 0m40.619s
user 0m40.412s
sys 0m0.134s
The difference in time needed to process both files is staggering. Is
there any possibility to speed this up? The difference in file size is
less than 30kB.
Distribution: PDF-API2-2.033
Perl version: 5.18.2
OS: Mac OS 10.13.3 (Darwin Kernel Version 17.4.0)
Thank you for your help!
Regards,
Dusan
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.