How are you loading/creating the numpy array or image?
Could you check the writeable flag via print(arr.flags['WRITEABLE'])?
If it’s set to False, you should create a copy of it as suggested by the warning message.