Can I move data away from devices to store on Icloud

I'm paying for more storage than my mac can hold, can I move data (photo's) to Icloud to free up mac, or is only back up?

Thanks

Gaza
If you enable iCloud Photo Library in iCloud on your Mac, you can either choose to save originals or to optimize storage.
If you go for Optimize storage, you’ll essentially free up storage on the Mac.

Original thread: https://forums.imore.com/threads/can-i-move-data-away-from-devices-to-store-on-icloud.406859/