How to detect transparency in figures