Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Detecting SRGB or Linear on export

New Here ,
Jun 22, 2009 Jun 22, 2009

Hi all,

I'm writing a custom dds exporter for our needs (dds is a texture format for 3D graphics). I haven't had too much trouble with it, except that I am having a great deal of trouble detecting wheter photoshop is giving linear or SRGB data. It appears to most of the time give me SRGB data when I'm in 8 bit mode, and most of the time give me linear data in 16 bit. However, if an artist goes from 16 bit to 8 bit mode - photoshop appears to go into an odd linear 8 bit mode. Thus, it doesn't convert the 16 bit linear into 8 bit SRGB.

I've all seen weirdness on import - most of the time it appears that photoshop assumes that 8 bit images are gamma, and everything else is linear, but I'm not 100% sure of this (as above mentioned case).

While certain formats seem to be able to still do this gamma conversion, (e.g. the tga saver), I can't figure out how to determine what space photoshop is in by the ExportData structure - andI can't find it in any the suites. Ideally, of course, I'd tell our artists to stick to 8 bit gamma textures so we don't lose precision, but I need to be able to detect the difference.

Thx,

-Dan

TOPICS
SDK
2.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Jun 22, 2009 Jun 22, 2009

Linear or other depends entirely on the ICC profile associated with the document.  The profile completely determines the interpretation of the values.

16 bit to 8 bit changes are just linear scaling - no profile conversions are needed.

When importing or creating a new document -- the default profile for that color mode will be used, unless an explicit profile is set for the new document.

No, TGA does not do any gamma or other profile conversions.  The user has to make an explicit choice to do a profile conversion.

The only time Photoshop forces data to be linear (gamma 1.0) is in 32 bit/channel mode.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 23, 2009 Jun 23, 2009

Thanks Chis,

I've run through the documentation for about half an hour, but I still can't find a way to query the color profile. How is this done? Can I change it programmatically? I'm trying to make something fool-proof for our artists who tend to forget to do things like click the right gamma settings on export

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Jun 23, 2009 Jun 23, 2009

The document profile is supplied to filter, export, and file format plugins - as shown in the SDK.

You can only change the profile from a script or automation plugin.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 24, 2009 Jun 24, 2009

So, I can get a handle to the ICCProfile data, and I think I can even lock and get the data through the handle suite, but I cannot find any documentation on how to interpret this data, either in the documentation or in the headers. It's appears to be just a nebelous blob of bytes. How can I determine from the handle of the ICC what color profile I am looking at?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Jun 24, 2009 Jun 24, 2009
LATEST

http://www.color.org/

Get the ICC profile specification, and maybe some sample code.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines