I have created a Bash Script tool to create your own SD Image of your own "rootfs" folder.
This script makes the image based on your required 'BOOT Partition Size' and size of your 'ROOTFS folder' plus whatever you set as 'FREE Partition Size'.
You should modify these values inside the script before creating the Image and it will make the SD image based on the sizes you have provided.
The script will create the .img file plus Block Map file (.bmap) which you easlily can write it to your SD card.
The GIT repository of these codes and documentation can be found here:
Feel free to improve it by contributing to its GIT repository