I have the similar problem, right-click to select "Create 9-Patch file...", the transparent area become black. It only occur in some images after converted by ImageMagick.
Check the image details by pngcheck tool:
xb@dnxb:/tmp$ pngcheck msg_box.png #original image
OK: msg_box.png (2251x967, 32-bit RGB+alpha, non-interlaced, 99.9%).
It becomes palette+trns after converted by ImageMagick:
xb@dnxb:/tmp$ convert msg_box.png -transparent white -trim msg_trim.png
xb@dnxb:/tmp$ pngcheck msg_trim.png
OK: msg_trim.png (394x311, 8-bit palette+trns, non-interlaced, 98.5%).
The solution is prefix the image with png32 to force it outputs RGBA:
xb@dnxb:/tmp$ convert msg_box.png -transparent white -trim png32:msg_trim.png
xb@dnxb:/tmp$ pngcheck msg_trim.png
OK: msg_trim.png (394x311, 32-bit RGB+alpha, non-interlaced, 99.4%).
xb@dnxb:/tmp$
Now when I paste this image in Android Studio and right-click to select "Create 9-Patch file...", then it able to keep transparent instead of black.