I don't know of a way to do this, but if you have enough space left on your drive, you could add a small, temporary partition instead of using a disk image. This creates a real partition, and can be done without erasing current partitions by resizing them.
Note: If you are partitioning your boot drive, you may need to run Disk Utility from either your install disk or the recovery partition for some versions of OS X. At least 10.8.3 allows you to do it directly, though.
First, open Disk Utility from the /Applications/Utilities folder and click on your hard drive in the sidebar (the disk, not the partition). Then, go to the Partition tab and click the + button. Click the new partition and enter an appropriate size and optionally rename it using the fields on the right. Then press the Apply button and wait.
When you are done testing with your partition, you can remove it by clicking on it in the Partition tab and pressing the - button. Then, drag the bottom of the other partition down so that it fills the free space left behind and press Apply.