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

Convert16to8 uses a short for count?!?

New Here ,
Jun 04, 2008 Jun 04, 2008

Copy link to clipboard

Copied

I'm trying to use the Color Space suite to convert 16-bit image data to 8-bit so that I can draw it. First, why in hell can't Photoshop plugins draw 16-bit image data, when Photoshop itself clearly can? Grrr...

OK, so much for the ranting. Now, can anyone tell me whose genius idea it was to make the "count" parameter to Convert16to8 a short? What good does it do to restrict us to 32768 pixels? That's a very small image! Am I misunderstanding the use of this parameter?

Also, this function seems to divide the 16-bit pixel values by 128 in order to get the 8-bit values. Anybody know why it's 128 and not 256? Are 16-bit pixel values signed?

Thanks,
Aaron
TOPICS
SDK

Views

909

Translate

Translate

Report

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
Participant ,
Jun 07, 2008 Jun 07, 2008

Copy link to clipboard

Copied

1. Photoshop images and the plugin API has historically been limited to 30,000 pixels. There is now an extended API (and PSB file format) that raises this.

2. Photoshop really stores only 15 bits (plus one value) for 16 bit data. Plugins will see values from 0 to 0x8000 inclusive, which correspond to the 0-0xffff range you were probably expecting.

I hope that clarifies ... something.

Votes

Translate

Translate

Report

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 08, 2008 Jun 08, 2008

Copy link to clipboard

Copied

Isn't it 30,000 pixels on a side? 30,000 pixels total would be a *very* small image, unrealistically so (VGA is over 10 times that!)

Thanks for the clarification about the 15-bit limit.

Aaron

Votes

Translate

Translate

Report

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
Participant ,
Jun 08, 2008 Jun 08, 2008

Copy link to clipboard

Copied

On a side, yes.

Votes

Translate

Translate

Report

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 18, 2008 Jun 18, 2008

Copy link to clipboard

Copied

Unfortunately, the count in Convert16to8 is the actual number of pixels. That means that it's totally useless for converting an image buffer of any size.

Votes

Translate

Translate

Report

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
Explorer ,
Jun 18, 2008 Jun 18, 2008

Copy link to clipboard

Copied

Is there a major obstacle to calling it in a loop convering 32K chunks
then the remainder?

Aandi Inston

Votes

Translate

Translate

Report

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 19, 2008 Jun 19, 2008

Copy link to clipboard

Copied

LATEST
No, it just complicates the code unnecessarily and introduces a potential perfomance hit. It's easier to write the thing myself in that case, which in fact is what I've done. It just seems to be a foolish interface decision, unless there is some other factor that I'm not aware of that's constraining the size of the buffer being passed in.

Thanks,
Aaron

Votes

Translate

Translate

Report

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