Skip to main content

TIFF to JPEG converstion inverted color

6 replies [Last post]
ahchao82
Offline
Joined: 2010-06-22

Hi guys,

For weeks, i've been trying to convert tiff images to jpeg. All the conversion result in the jpegs having inverted colors. E.g. original white background and black text in Tiff becomes black background and white text in Jpeg

The tiff images are read in using the imagedecoder and are compressed using 'compression_group4'. Jpegs are written using imagewriter and compression is set to 'jpeg". i do not have the compression modes "jpeg-lz" or "jpeg-lossless".

Have anyone faced this problem before? Any help would be greatly appreciated.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ahchao82
Offline
Joined: 2010-06-22

Problem resolved!

Using TIFF MetaInfo Photometric Interpretation (BlackIsZero/WhiteIsZero) helps!

Thanks marco !

rpa_rio
Offline
Joined: 2004-01-24

I have a similar problem here, how did you changed the photometric interpretation?

nemesis666
Offline
Joined: 2006-09-27

could anybody post a solution code for this

ahchao82
Offline
Joined: 2010-06-22

Problem resolved!

Using TIFF MetaInfo Photometric Interpretation (BlackIsZero/WhiteIsZero) helps!

Thanks marco !

marcojacob
Offline
Joined: 2006-07-10

Maybe the TIFF MetaInfo PhotometricInterpretation (BlackIsZero/WhiteIsZero) ist not decoded valid, not set correct (different default used) or must be given as a hint to ImageIO?

ahchao82
Offline
Joined: 2010-06-22

That sounds logically.. May I know where can I get a sample code of that to try it out?