Find the block device id of the SD card you are creating an image from:
pi@pi ~ $ sudo blkid /dev/mmcblk0: PTUUID="a6202af7" PTTYPE="dos" /dev/mmcblk0p1: SEC_TYPE="msdos" LABEL="boot" UUID="15CD-3B79" TYPE="vfat" PARTUUID="a6202af7-01" /dev/mmcblk0p2: UUID="13d368bf-6dbf-4751-8ba1-88bed06bef77" TYPE="ext4" PARTUUID="a6202af7-02"
in my case /dev/mmcblk0. Then you can either create the image on the pi or, like below, ssh and transfer it to where you want to save the image:
ssh [email protected] "sudo dd if=/dev/mmcblk0 | gzip -1 -" | dd of=rpi_image.gz
In a separate window monitor with:
sudo pkill -USR1 dd
or via pv (if on a mac will need to brew install pv first):
cat filename | pv
see instructions here