I believe imagemagick could help to fix this.