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

Forcing 32 bit PNG export

Community Beginner ,
Jun 06, 2019 Jun 06, 2019

I'm working on a script where I need to export certain assets as 32 bit PNGs (PNG24 + Alpha). When exporting these manually - Quick Export as PNG works perfectly every time and preserves an alpha bit depth - even if the image has no transparency. But Quick Export as PNG doesn't work in scripting.

When I've tried exporting via other means, when the image in question doesn't have transparency the export results in no alpha bit depth. Is there a way to force alpha bit depth via other export means in scripting?

I've tried using various save for web legacy  scripting settings with transparency = true, as well as normal save scripts that set the file type to PNG, but so far the only 2 methods that preserve transparency are Quick Export as PNG and the Generator Image assets - but from what I can tell there is no way to 'toggle' Generator on/off within a script.

Any help would be appreciated!

TOPICS
Actions and scripting
9.6K
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

correct answers 1 Correct answer

People's Champ , Jun 10, 2019 Jun 10, 2019
Why do you need such files?
Make a white layer mask. Set the top left pixel of mask to level 254. Save PNG in any way.

Translate
Adobe
People's Champ ,
Jun 06, 2019 Jun 06, 2019

Turn off the layer. Save an empty file as PNG (with not a copy!).

Turn on layer. Save (not save as) the file.

Bingo.

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
Community Beginner ,
Jun 10, 2019 Jun 10, 2019

Unfortunately resaving the file per your method above does not preserve the alpha bit depth when the layer is turned back on.

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
People's Champ ,
Jun 10, 2019 Jun 10, 2019

Yes, exactly, on CC2018 does not work. On CS6 works.

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
Community Beginner ,
Jun 10, 2019 Jun 10, 2019

Unfortunately part of the reason for this script is so that multiple users on my team can use it - forcing them to install previous versions of Photoshop to run the script is counterintuitive for the end goal of speeding up workflow.

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
People's Champ ,
Jun 10, 2019 Jun 10, 2019
Why do you need such files?
Make a white layer mask. Set the top left pixel of mask to level 254. Save PNG in any way.

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
Community Beginner ,
Jun 10, 2019 Jun 10, 2019

The tool for slotting these PNGs sometimes runs into errors if the bit depth is incorrect, so the tool we use to check these files always marks them as failing if they don't have 32 bit bit-depth. Since "Quick Export As..." always saves PNGs as 32 bit, for manual production of these files - it's not a problem. The problem only occurs when you try to automate this process to speed up workflow.

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
Community Beginner ,
May 21, 2022 May 21, 2022
LATEST

Quick Export as PNG does not save PNG's as 32 bit for me.

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