Can resize like that?

Thank!

You’ll want to use the Image ▸ Resize Canvas… menu item, and then fill in the transparent areas with black (the easiest way is to use the flood fill tool).