How to create synthetic RAW image?

After some googling I think I nailed it:

convert hald:12 -depth 16 -colorspace RGB -gravity NorthWest -splice 4x4 -gravity SouthEast -splice 4x4 -define tiff:fill-order=msb-to-lsb foo.tif

Thanks @Morgan_Hardwood or sharing your findings.

I wish I knew how to add mosaic to the raw data.