Page 1 of 1

Conversion taking too long for some PNG images

Posted: 2016-03-07T02:37:14-07:00
by dusan.rychnovsky
Hi,

I'm running ImageMagick version 6.8.8-10 Q16 x86_64 2015-08-14 on Debian GNU/Linux 7 (Wheezy).

Resizing some PNG images takes too long.

For example,

* this image takes almost 2.5 minutes: http://img04.deviantart.net/49f6/i/2015 ... 9izg8o.png
* this image takes around 4 minutes: http://img08.deviantart.net/b9ae/i/2015 ... 8zqaj2.png

Other images are processed fine.

Is there something wrong with the images or why is it taking so long?

Thanks,
Dusan

Re: Conversion taking too long for some PNG images

Posted: 2016-03-07T02:45:26-07:00
by snibgo
What is your exact command?

With your first image, IM v 6.9.2-5, ...

Code: Select all

convert __parishilton___by_allleee-d9izg8o.png -resize 100x100 p.png
... takes my laptop about 1 second.

Re: Conversion taking too long for some PNG images

Posted: 2016-03-07T22:37:59-07:00
by GeeMack
dusan.rychnovsky wrote:Is there something wrong with the images or why is it taking so long?
I'm using "ImageMagick 6.9.3-6 Q16 x64 2016-02-28" on Windows 7 64, and when I run this command...

Code: Select all

magick psd_dl_by_xxcaramellchanxx-d8zqaj2.png test.png
I get this warning...

Code: Select all

magick: zTXt: truncated `psd_dl_by_xxcaramellchanxx-d8zqaj2.png' @ warning/png.c/MagickPNGWarningHandler/1683.
I don't get any warning or error when trying to convert the "__parishilton___by_allleee-d9izg8o.png" file. I do notice both files seem especially large for having relatively small dimensions.

The "psd_dl_by_xxcaramellchanxx-d8zqaj2.png" image is only 400x400 pixels, but "identify" show it as 3.042MB.

The "__parishilton___by_allleee-d9izg8o.png" image is only 700x450 pixels, and "identify" shows it as 2.891MB.

When I do this...

Code: Select all

convert __parishilton___by_allleee-d9izg8o.png test1.png
...it creates a file that is still pretty huge, almost 3MB.

When I run this command...

Code: Select all

convert psd_dl_by_xxcaramellchanxx-d8zqaj2.png test2.png
... it results in a file about 202KB, which seems a lot more reasonable.

My somewhat educated guess is both of your images have some sort of problem.

Re: Conversion taking too long for some PNG images

Posted: 2016-03-07T23:26:16-07:00
by fmw42
I'm using "ImageMagick 6.9.3-6 Q16 x64 2016-02-28" on Windows 7 64, and when I run this command...
magick psd_dl_by_xxcaramellchanxx-d8zqaj2.png test.png
I believe the command "magick" is only for IM 7.

What version of libpng are you using? Is it current?

convert -list format

should tell you the version of libpng.

Using your second image on IM 6.9.3.7 Q16 Mac OSX with libpng 1.6.20

Code: Select all

time convert psd_dl_by_xxcaramellchanxx-d8zqaj2.png -resize 100x100 test.png
convert: zTXt: truncated `psd_dl_by_xxcaramellchanxx-d8zqaj2.png' @ warning/png.c/MagickPNGWarningHandler/1656.

real	0m0.127s

Re: Conversion taking too long for some PNG images

Posted: 2016-03-08T07:51:48-07:00
by GeeMack
fmw42 wrote:I believe the command "magick" is only for IM 7.
Yep, my mistake. I was working those sample images for the opening poster. I tried them using IM6 and IM7 and got the same results with each. I mentioned my IM6 version and pasted my IM7 command. Sorry about the confusion.

Re: Conversion taking too long for some PNG images

Posted: 2016-03-10T10:01:32-07:00
by glennrp
Both of the images from deviantart contain huge (3-4MB) zTXt chunks containing 8BIM and XMP profiles.