TagPhotometricInterp -- possible values?

Example requests & Code samples for GdPicture Toolkits.
Post Reply
felix
Posts: 20
Joined: Mon Apr 19, 2010 2:54 pm

TagPhotometricInterp -- possible values?

Post by felix » Wed Jul 21, 2010 9:13 am

Hello all,

I'd like to set the TagPhotometricInterp for my TIFF image.
What are the possible values I may set?

I need to set it to (translated from german): White is Zero. I don't know what it's really called...

Best,
Felix

/edit:
I set the value with:

Code: Select all

GD_Image.TagSetValueString(m_TMP_Image, Tags.TagPhotometricInterp, TagType.TagTypeShort, "0");
After that, I save the Image:

Code: Select all

  if ((GD_PicStat = GD_Image.SaveAsTIFF(m_TMP_Image, strFilename, GD_Image.GetTiffCompression(m_TMP_Image))) != GdPictureStatus.OK) {//error output}
When I check if the tag is available with strTagName.CompareTo("PhotometricInterp") - it is. It's the 9th tag in the image.
When I check the value with GD_Image.TagGetValueString(m_TMP_Image, 9);, the value is 0. But even if the value is set to "1", I get a zero with this...

BUT Photome tells me all the time, PhotometricInterpretation is "RGP Palette".

How can I change this correct?

User avatar
Loïc
Site Admin
Posts: 5713
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: TagPhotometricInterp -- possible values?

Post by Loïc » Wed Jul 21, 2010 8:26 pm

Hi Felix,

Changing the photometric tag has no impact when you save your image. Why do you want to do that ??

Kind regards,

Loïc

felix
Posts: 20
Joined: Mon Apr 19, 2010 2:54 pm

Re: TagPhotometricInterp -- possible values?

Post by felix » Thu Jul 22, 2010 8:05 am

Because its not correct.

I open the image and rotate the image. After rotating the image I save the image again.
After rotating and saving, the Photometric Tag and the Compression has been changed. I don't know why... The compression should be the same as on the image before rotating. (GD_Image.GetTiffCompression(m_TMP_Image))) - But it isn't. But I don't care about the compression right now.
The Photometric Tag will change, too. Before rotating it's "Weiß ist Null" / "White is Zero" ("Min is White"?). After rotating it is "RGB Palette".

After rotating and saving the image, I need to convert the TIFF from Single-Strip to Multi-Strip. Because GdPicture isn't able to do this, I need to use another tool -> LibTiff.NET / TiffCP.exe
With this tool, I convert the TIFF File.
So without rotating it all works fine. With rotating it inverts the colors after converting. And that would be, because of the Photometric Tag, I think.

I hope you do understand why I need to do this. Hopefully you can tell me how to do it...
If you have another solution that works, it would be fine, too. But it has to work. The sooner the better - my customers can't wait forever... I need to fix the problem this week.

felix
Posts: 20
Joined: Mon Apr 19, 2010 2:54 pm

Re: TagPhotometricInterp -- possible values?

Post by felix » Thu Jul 22, 2010 1:54 pm

Ignore my posts...
I found the error. Your Image-Tools like rotating, despeckle, and so forth, change the compression all the time to LZW. That's the point. Cause of that, the photometric tag changes to RGB. If I change the compression by myself back to G4, everything works fine.

User avatar
Loïc
Site Admin
Posts: 5713
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: TagPhotometricInterp -- possible values?

Post by Loïc » Thu Jul 22, 2010 3:20 pm

OK Felix thank you for the update.

I stop investigations on this issue.

Kind regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest