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

How to Auto-Recreate a Gradient from Rasterized layer in Pts

Community Beginner ,
Mar 22, 2025 Mar 22, 2025

Hi everyone,

I often work with rasterized text layers where Layer Styles (like gradients) are lost. Manually recreating gradients using the Eyedropper tool takes too much time, Therefore, I'm looking for a script that can:

1, Auto-detect and extract the gradient from a rasterized layer.
2, Recreate the gradient and save it as a Custom Gradient in Photoshop.
3, (Optional) If possible, restore other lost Layer Styles like strokes or shadows.

I repeat this task often, so automation would be a huge time-saver. 

Any guidance or script suggestions would be deeply appreciated!

🙏 Huge thanks in advance!

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

Community Expert , Mar 23, 2025 Mar 23, 2025

IMO I am afraid that there is no script solution for this problem.
A script can read coordinates and colour values, for example. But a colour gradient can have so many settings - it's like trying to turn an omelette back into an egg.
Sorry

Translate
Adobe
Community Expert ,
Mar 22, 2025 Mar 22, 2025

Why are the gradients lost? What steps lead to this unwanted result? I obviously haven't seen this first hand. You're much better fixing this at the source.

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 ,
Mar 22, 2025 Mar 22, 2025

Thanks for your response!

In my case, I don’t have access to the original layers with editable Layer Styles. The files source I receive already have rasterized text layers with gradients, meaning the original Gradient Overlay (or other effects) is lost.

That’s why I’m looking for an efficient method to extract and recreate gradients automatically. Since I have to do this process frequently, I’m looking for a way to automate it rather than manually recreating.

I was wondering if there’s any script that could help speed up this process? I’d really appreciate any suggestions!

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 Expert ,
Mar 23, 2025 Mar 23, 2025

IMO I am afraid that there is no script solution for this problem.
A script can read coordinates and colour values, for example. But a colour gradient can have so many settings - it's like trying to turn an omelette back into an egg.
Sorry

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 Expert ,
Mar 23, 2025 Mar 23, 2025

@BongBong6868 , as @Stephen Marsh already hinted at: The people sending you degraded files should stop deliberately damaging the images before handing them off to you. 

 

• If I remember correctly Illustrator’s Image Trace has been improved in recent years and should be able to create proper gradients – I am not sure if it would do so well enough for your needs and it would likely not fit well inside your workflow. 

• Libraries’ »Extract from Image« does not seem to be fully up to the task. 

Screenshot 2025-03-23 at 16.13.06.pngexpand image

 

I guess I concur with @pixxxelschubser ’s assessment. 

And the same goes for reconstructing Strokes and Drop Shadows, which you also mentioned in the original post. 

 

In this day and age it may be tempting to wonder: »Couldn’t AI do it?« and the answer would probably be: »Yes« but would it be worth the resources? 

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 ,
Mar 23, 2025 Mar 23, 2025

Thank you all for your responses!

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 Expert ,
Mar 23, 2025 Mar 23, 2025

Are there any constraints on the gradients that might make evaluating easier – are they always linear, at 90˚, …?  

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 ,
Mar 23, 2025 Mar 23, 2025
LATEST

Most of the gradients I’m working with are linear, and they are typically set at a fixed angle, like in this example (110°).

Screenshot 2025-03-23 224758.pngexpand image

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