Skip to main content
Participant
March 26, 2020
Answered

How can I script like making shader like HLSL or GLSL?

  • March 26, 2020
  • 2 replies
  • 2746 views

 Hi. I'm quite new to Photoshop scriping.

 What I want to do is kind of image processing. Making custom blur or custom tone mapping by using my custom formula. Normally, I do this kind of works not in photoshop, but our team need this in Photoshop. 

 

Firstly, Is there any way to apply HLSL or GLSL to image in photoshop?

I found the scripting in photoshop, looks like it can sample color from pixel, and then set color to pixel. but this is quite slow for use it. Are there any way to make faster? the native photoshop filter is quite fast. How did they do for it?

 

This topic has been closed for replies.
Correct answer Vladimir338472574n58

Hey, it's possible to apply shaders code using the Photoshop Shader Plugin which may be found on its itch.io page: https://hellmapper.itch.io/photoshop-shader-plugin

2 replies

Vladimir338472574n58Correct answer
Participant
November 25, 2023

Hey, it's possible to apply shaders code using the Photoshop Shader Plugin which may be found on its itch.io page: https://hellmapper.itch.io/photoshop-shader-plugin

Legend
March 26, 2020

As far as I know, the script cannot access the pixels of the image directly. If you stay within the scripting language of Photoshop, that is, a very long and inefficient way of working with pixels is to read each pixel through the colorSampler tool, process the resulting array, then assign a color to each pixel through make selection & fill. It is really very long and inefficient.
A more effective option is to save the image to disk and transfer its processing to an external script / program, and then upload the result to Photoshop.

c.pfaffenbichler
Community Expert
Community Expert
March 26, 2020

And I suppose a proper Filter plugin programmed in C++ should also be more efficient than a Scripting-approach.