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

Сonvert all open files to black and white

Community Beginner ,
Dec 27, 2021 Dec 27, 2021
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
TOPICS
Actions and scripting , Windows
558
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

LEGEND , Dec 27, 2021 Dec 27, 2021

 

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

 

Translate
Adobe
LEGEND ,
Dec 27, 2021 Dec 27, 2021

 

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

 

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 ,
Dec 27, 2021 Dec 27, 2021
Kukurykus
Thank you very much, great!
It works!

Sincerely,
Niyetkhan
 
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
LEGEND ,
Dec 27, 2021 Dec 27, 2021

Mark as correct solution to confirm that 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 Expert ,
Dec 27, 2021 Dec 27, 2021
LATEST

@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

 

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