Change image resolution (dpi) with AppleScript or Automator

hi to everyone! i’m Italian, sorry for my English.
so i need to change the dpi and the resolution of a lot of images for my “the frame” tv. it needs a specific resolution: 3840x2160 @ 300 dpi.
to do this i made a quick action with automator.
i wrote this commands:

sips --resampleHeightWidth 2160 3840 "$@"
sips -s dpiHeight 300.0 -s dpiWidth 300.0 "$@"

the resolution works but the dpi not. can someone help me? the original images are higher or lesser with dpi but no works in any cases.
thank you!