Conversion taking too long for some PNG images

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
dusan.rychnovsky
Posts: 1
Joined: 2016-03-07T02:25:19-07:00
Authentication code: 1151

Conversion taking too long for some PNG images

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Conversion taking too long for some PNG images

Post 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.
snibgo's IM pages: im.snibgo.com
User avatar
GeeMack
Posts: 718
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Re: Conversion taking too long for some PNG images

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Conversion taking too long for some PNG images

Post 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
User avatar
GeeMack
Posts: 718
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Re: Conversion taking too long for some PNG images

Post 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.
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: Conversion taking too long for some PNG images

Post by glennrp »

Both of the images from deviantart contain huge (3-4MB) zTXt chunks containing 8BIM and XMP profiles.
Post Reply