Page 1 of 1

Cropped PNG is blank.

Posted: 2011-02-15T13:03:46-07:00
by arizonagroovejet
I create a PNG.

Code: Select all

$ convert -background transparent -fill black -gravity center -size 1680x1050 -font Arial-Bold caption:"HAPPY\nBIRTHDAY"  happybirthday.png
The result is a PNG image 1680x1050 with black text on a transparent background.

Then I crop the image.

Code: Select all

$ convert happybirthday.png -gravity center -crop 500x500+0+0 +repage happyfoo.png
What I expect to get is a 500x500 PNG that contains the middle 500x500 pixels of happybirthday.png. What I actually get is a 500x500 PNG that is entirely transparent.

Can anyone explain why I get an entirely transparent image and how to get the expect result?


Version: ImageMagick 6.6.7-1 2011-02-05 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP OpenCL

Installed using MacPorts on

ProductName: Mac OS X
ProductVersion: 10.6.6
BuildVersion: 10J567

Re: Cropped PNG is blank.

Posted: 2011-02-15T14:12:39-07:00
by fmw42
I can confirm your results on IM 6.6.7.7 Q16 Mac OSX Tiger.

But keep in mind that PNG has been undergoing quite some changes over the last number of releases and still has some bugs to be fixed that glennrp is working hard to continue to fix. see http://www.imagemagick.org/script/changelog.php

In the meantime, this works.

convert happybirthday.png -gravity center -crop 500x500+0+0 +repage PNG32:happyfoo.png