Can I delete my pictures in camera roll and still keep those pictures in my icloud library?

well I've been trying to find out if i could erase all of my photos in my camera roll but still have copies of it in my icloud library.

what I'm planning to do is i'll just save all my photos in icloud library and would have the freedom of erasing all the pictures just in my iphone.

i have tried enabling the icloud library in my iphone and tried deleting some pictures in my camera roll but as soon as i deleted the picture it also deletes the picture in icloud library, seems like they are synced to what you have in your camera roll. I wanted to know how can i make my icloud library just for safekeeping.

thanks.
This should answer your question:

How to use iCloud Photo Library: The ultimate guide | iMore
Your camera roll syncs to your iCloud Library and so if you delete pics from one, the result will sync to the other. Unless I'm mistaken, the only way to do what you're asking is to disable iCloud Library and then use a third-party cloud service where you have the option to "upload" or "sync".

Original thread: https://forums.imore.com/threads/can-i-delete-my-pictures-in-camera-roll-and-still-keep-those-pictures-in-my-icloud-library.327732/