To add e.g. 30 GB to an existing raw image usethis command:
qemu-img resize nameofimg.img +30G
In my case, the command was run instantly and it added 30 GB to my existing file, as expected. The output was:
WARNING: Image format was not specified for 'nameofimg.img' and probing guessed raw.
Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
Specify the 'raw' format explicitly to remove the restrictions.
See also QEMU Emulator User Documentation > qemu-img Invocation or the man page:
In my case my image was used in a Windows 10 virtual machine. In the Windows 10 VM: click Start and search "partitions" > the search finds "Create and format hard disk partitions" > which clicked opens up "Disk Management" > Right click target partition > Extend > follow the instructions to extend your partition. It's super easy.