Edit: I have changed the clip to updateMask function. when I print the image dimensions it seems to be ok with size, but when I export image GCS and then open again, it adds empty row /column to the image. I couldn't find any reason why.

I have two images which are different size . I want to clip img2 using img 1, and to get image that has the exactly same dimensions as img1.

img1 has the following shape: [425, 327] img2 has the following shape: [426, 329]

I have tried to clip them using GEE as following:



#print of imgs size

print(f'img1 size:{sz_orig}  img2 size"{sz_be}    clipped size: {sz_clip}')

original size:[425, 327]  img2 size"[426, 329]    clipped size: [426, 328]

My problem is that I need to get the clipped img with the same size as img1, but this doesn't happen and I get something new.

I though maybe it has to do with projection, so I have tried to do the same but to reproject img2 to have the same projection as img 1 before clipping:



#tried also like this but same size result:


original size:[425, 327]  img2 size"[426, 329]    clipped size: [426, 328]

I still don't have clipped_size with the same size as img1.

My end goal is to have the clipped image with the exactly same shape as img1.

1 Answer 1


Are the two images registered / georeferenced? Do they overlap the way you'd expect when imported? Can you share the assets that were imported?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.