I'm trying to crop a small part of an image. I used ImageMagick command for this as below:
convert image.jpg -crop 6x6+16+16 +repage image_crop.jpg
However, when I try to compare pixel values in both the images for the same block, it doesn't match. For example, pixel value at position (16,16) in image.jpg
should match with pixel value at (0,0) in image_crop.jpg
. Any ideas on how to crop an image so that pixel values are not modified?
Note: I'm comparing the pixel values by dumping the image data into a text file as below:
convert image.jpg image.txt