Page 1 of 1

crop behaviour for convert

Posted: 2009-06-23T11:25:28-07:00
by victorlesk
Hi I have an image a.pnm of size 12x12.

I run the crop command

convert -crop 12x12 b.pnm

Which should result in exactly the same image. However, the file size is different, so I can't use unix diff to compare them. Why is the output file different from the input file, and how can I make them the same?

Thanks = Victor

Re: crop behaviour for convert

Posted: 2009-06-23T16:57:31-07:00
by fmw42
is your original 8-bits and are you on a Q16 IM? if so you may be converting 8-bit image to 16-bit image.

Also your crop command is not correct (perhaps typo - but you only specify one image)

Try

convert a.pnm -crop 12x12+0+0 +repage a2.pnm

add -depth 8 if you want to keep 8-bits and are on a Q16 IM.

What does

identify -verbose a.pnm

tell you about the input and do the same on your output a2.pnm