A plaintext-related image encryption algorithm based on chaos