You should be able to generate a compressed DietPi image via the dietpi-imager script. This script is located in the .meta subdirectory in the GitHub DietPi share or can be executed via:
bash -c "$(curl -sSfL 'https://raw.githubusercontent.com/MichaIng/DietPi/master/.build/images/dietpi-imager')"
But this would require to have the SD card placed as USB connected device on another Linux box. It will not work on a running system as the script is simply not designed for this.
To get the partition resized on first boot, you would need to activate dietpi-fs_partition_resize.service before creating the image.