16-bit png renditions | Community
Skip to main content
May 23, 2023
Solved

16-bit png renditions

  • May 23, 2023
  • 1 reply
  • 742 views

Hi,

 

I'm sure this is an easy one, but I can't see for looking.

 

In AEM Assets, when I upload a 16-bit png, I need the renditions it generates to also be 16-bit png. Currently, I can only get the system to generate 8-bit png's, so Im losing the alpha channel.

 

Any pointers will be much appreciated

Cheers

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by MayurSatav

hi @damiond-321 ,

You can create a custom workflow model to handle the generation of 16-bit PNG renditions. Here's an alternative approach:

  1. Access the AEM Workflow Console:

    • Log in to your AEM author instance.
    • Navigate to Tools -> Workflow -> Models.
    • Click on the "Create" button to create a new workflow model.
  2. Define the workflow model:

    • Give the workflow model a suitable title and name.
    • Add the "Thumbnail Process" step to the workflow model. This step is responsible for generating renditions.
    • Configure the "Thumbnail Process" step to generate the desired rendition sizes and formats.
  3. Add a custom process step:

    • Add a custom process step after the "Thumbnail Process" step.
    • Configure the custom process step to execute a script that modifies the rendition options.

    Here's an example script that sets the rendition options for 16-bit PNG:

 

// Create custom rendition options var renditionOptions = { mime: "image/png", quality: 1.0, bitDepth: 16 }; // Get the asset object var asset = workflowData.getPayload(); // Update the rendition options for all renditions asset.addRenditionOptions(renditionOptions);

 

4. Save and activate the workflow model.


This custom workflow model will generate 16-bit PNG renditions for your assets. You can initiate this workflow manually or configure it to run automatically when assets are uploaded or modified.

1 reply

MayurSatav
Community Advisor and Adobe Champion
MayurSatavCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
May 23, 2023

hi @damiond-321 ,

You can create a custom workflow model to handle the generation of 16-bit PNG renditions. Here's an alternative approach:

  1. Access the AEM Workflow Console:

    • Log in to your AEM author instance.
    • Navigate to Tools -> Workflow -> Models.
    • Click on the "Create" button to create a new workflow model.
  2. Define the workflow model:

    • Give the workflow model a suitable title and name.
    • Add the "Thumbnail Process" step to the workflow model. This step is responsible for generating renditions.
    • Configure the "Thumbnail Process" step to generate the desired rendition sizes and formats.
  3. Add a custom process step:

    • Add a custom process step after the "Thumbnail Process" step.
    • Configure the custom process step to execute a script that modifies the rendition options.

    Here's an example script that sets the rendition options for 16-bit PNG:

 

// Create custom rendition options var renditionOptions = { mime: "image/png", quality: 1.0, bitDepth: 16 }; // Get the asset object var asset = workflowData.getPayload(); // Update the rendition options for all renditions asset.addRenditionOptions(renditionOptions);

 

4. Save and activate the workflow model.


This custom workflow model will generate 16-bit PNG renditions for your assets. You can initiate this workflow manually or configure it to run automatically when assets are uploaded or modified.

Mayur Satav | www.mayursatav.in
May 23, 2023

Amazing, thank you so much.

I'll give this a go

 

Cheers

Damion