I am having different result when cropping two png files.
Imagick Version using convert -version
:
The two files using identify
:
works.png PNG 1218x610 1218x610+0+0 8-bit DirectClass 755KB 0.000u 0:00.000
doesntwork.png PNG 70x70 70x70+0+0 8-bit DirectClass 1.64KB 0.000u 0:00.000
I am using this command:
convert <original>.png -crop 50x50+0+0 <target>.png
The problem is that works.png
is 100% correct, while doesntwork.png
is a black square.
Both original images seem to be the same - and do display correctly on windows 7
.
The images:
works.png
:
doesntwork.png
:
Works for me using convert -version
ImageMagick 6.4.0 04/17/08 Q16 (which is the "Current" version under cygwin
), running via cygwin on Windows XP SP3.
It may be a bug in your particular version of ImageMagick. The shark works.png
is a full color image with alpha (4 8-bit channels). The doesntwork.png
is a 1-bit black and white image with 8 bits of alpha, and the shading is done by varying the alpha. That seems to me a rather rare format, so I can imagine a bug slipping into the conversion code.
You might try converting the image to true color first.