0

I'm capturing an image from an android mobile device and its in JPEG format. The image is of 72X72DPI and 24 bit. Now, when I try to convert this JPEG image to TIFF using LibTiff.Net and to set the tag Photometric Interpretation = 0 for MinIsWhite, the image turns negative (the white becomes black and black becomes white). The environment is Windows 8.1 64 bit, Visual Studio 2012. Can you please help/suggest how to resolve this issue? Any help is highly appreciated.

Thanks, Harshal

Harshoo
  • 3
  • 5
  • Why do you need Photometric Interpretation == 0? MinIsWhite is intended for bilevel FAX documents, which are mostly white (ie. more paper than ink) because it yields better compression ratio in combination with Compression == 2 (CCITT). It's not intended for natural images (like the ones captured from a mobile camera). – Harald K Nov 28 '14 at 11:50

1 Answers1

1

Use Photometric.MINISBLACK instead of Photometric.MINISWHITE.

If you absolutely must use Photometric.MINISWHITE in your images then the only option is to invert image data before writing it to TIFF.

Bobrovsky
  • 13,789
  • 19
  • 80
  • 130
  • Hi, thanks for the suggestion. But as per the specifications, the tag must have value 0, where 0 = white is zero. How can I set that? – Harshoo Nov 28 '14 at 10:39
  • Hi, thanks for the suggestion. But as per the specifications, the tag must have value 0, where 0 = white is zero. How can I set that? – Harshoo Nov 28 '14 at 10:39
  • 1
    When used Photometric.MINISBLACK, the image comes fine without issue. But as per the systems specifications, the tag must have value 0, where 0 = white is zero. How can I set that? Is it required to convert the original JPEG to TIFF and then use the TIFF image for processing in buffer? Currently I'm taking the JPEG image directly for processing in buffer and then while converting it to TIFF, I'm also setting the tags. – Harshoo Nov 28 '14 at 11:13
  • And how to achieve that? Inverting the image data..? – Harshoo Nov 28 '14 at 12:40
  • @Harshoo Ask another question and don't forget to post your code. – Bobrovsky Nov 28 '14 at 12:46
  • I just posted another Q with full code that I'm using. Please have a look. – Harshoo Nov 28 '14 at 13:48