Skip to main content
niyetkhan
Known Participant
December 28, 2021
Answered

Сonvert all open files to black and white

  • December 28, 2021
  • 2 replies
  • 574 views
Hello,

I have a question:
Is it possible to write such a script using JS:

In PS: I have to convert all open files to black and white images (desaturate)

I would be very grateful for your answers.

Sincerely,
Niyetkhan
This topic has been closed for replies.
Correct answer Kukurykus

 

dcmnts = [].slice.call(documents); while(dcmnts.length)
	(activeDocument = dcmnts.shift()).activeLayer.desaturate()

 

2 replies

Stephen Marsh
Community Expert
Community Expert
December 28, 2021

@niyetkhan – I'm just curious, why desaturate? The reason that I ask is that desaturate is often considered the worst of the many ways to create a grayscale/black & white image. If it works for you, that is of course fine.

 

Conversions depend on the image content, what works well for one image may not be the best for all images. For automating among many images, this will often be a compromise. That being said, some compromises may be considered better than others.

 

EDIT: As an example, 5 base methods are included in the following script to create 20 variations, and there are surely more base methods available.

https://morris-photographics.com/photoshop/scripts/bw-variations.html

 

Kukurykus
KukurykusCorrect answer
Legend
December 28, 2021

 

dcmnts = [].slice.call(documents); while(dcmnts.length)
	(activeDocument = dcmnts.shift()).activeLayer.desaturate()

 

niyetkhan
niyetkhanAuthor
Known Participant
December 28, 2021
Kukurykus
Thank you very much, great!
It works!

Sincerely,
Niyetkhan
 
Kukurykus
Legend
December 28, 2021

Mark as correct solution to confirm that works 😉