Resize a Disk Image

Resize:
hdiutil resize -size 25g /PATH/TO/DISK/IMAGE.dmg


Compress a sparseimage:
hdiutil compact /PATH/TO/DISK/IMAGE.sparseimage