When taking a screenshot with the combination of cmd + shift + 4, macOS adds a shadow to the screenshot automatically.
If you don't want to have the shadow, then after pressing the combination keys above, pressing and holding the alt + space keys.
Then clicking the target window will produce a screenshot without the shadow.
The shadowless screenshot below is an example when capturing the 1 LOC website:

More
