Use Disk Utility to create a new image, and for "Image Format" make sure you use "Sparse Bundle Disk Image", then select your encryption type.
"Sparse" means the image will start at a relatively small size and grow only as much as it needs to contain what you put in it.
By the way, there is another image format called "Sparse Disk Image" (not a bundle). This will function similarly; the difference is that a sparse bundle behaves intelligently when using Time Machine to back it up, but a sparse disk image does not. If you change one bit inside a sparse disk image, Time Machine will have to make a copy of the entire file, but if you use a sparse bundle it will only copy the small portion that changed. The only downside is that the sparse bundle was added in Leopard; use a sparse disk image if you need compatibility with Tiger or older.
Is anyone aware if there are tools to read such an encrypted sparse bundle disk image in other linux environments? – drevicko – 2015-06-27T00:54:24.737
2What is the difference between Sparse Bundle Disk Image and Sparse Disk Image? – Wuffers – 2010-04-24T18:07:20.877
4
When deleting large files from within such image, then see How to reclaim all/most free space from a sparsebundle on OS X
– Arjan – 2010-04-24T18:07:39.3472Just added the difference, since I had to go learn it myself =) – Stephen Jennings – 2010-04-24T18:08:31.670
1In recent versions of macOS, this option is now called simply "read/write" – bloudermilk – 2017-06-01T05:14:13.520