# Why my trimmed image is blank and the imported image is so small?

This is the first time I use Mathematica to do image processing, and I just want to remove the coordinate axes from this image.

Initially, I obtained the coordinates of the bottom-left corner as approximately (8,6) and the coordinates of the top-right corner as (28,22).

However, when I applied ImageTrim, it resulted in a blank image.

Could there be a mistake in my understanding of this?

By the way, why my output of imported image is so small?

Thank you.

i = Import["C:\\image-xF-bw.png"]
ImageTrim[i, Rectangle[{8, 6}, {28, 22}]]


The displaying size of an Image[…] is influenced by ImageResolution option:

So are the coordinates obtained by [Right-click] ▶ Get Coordinates. At least in version 14, the coordinates will be consistent with the standard image coordinate system (the coordinate system used by ImageTrim, etc., see the Details and Options section of ImageTrim for more info) when ImageResolution -> 72:

img = Import["https://i.sstatic.net/211uP.png"];
Image[img, ImageResolution -> 72]


Alternatively, using a Graphics to wrap the Image[…] will also transform the coordinates to the standard image coordinate system:

Graphics[img, Axes -> True]


With either of the methods above, the correct coordinates can be obtained:

• Wow, so much useful information. I'll digest it thoroughly. Thank you so much! Commented Mar 4 at 8:16
img = Import["https://i.sstatic.net/211uP.png"]


First get the ImageDimensions:

ImageDimensions[img]


{498, 406}

ImageTrim[img, {{120, 100}, {480, 360}}]


These coordinates are {x1,y1}, {x2,y2} (lower left, upper right).

or you could try:

ImageTake[img, {40, 300}, {120, 480}]