High Dynamic Range Image Compression by Optimizing Tone Mapped Image Quality Index