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

How to use JavaScript to extract individual panels from comic book pages

New Here ,
Apr 29, 2020 Apr 29, 2020

Copy link to clipboard

Copied

Hello,

My name is Freddy Jensen. I am a new user to Photoshop.

I have some jpeg images from some comic books. See

attached file. I would like to extract each panel and save

them as individual jpeg files. I can do it manually by

using the Windows Paint3D cropping tool, but it is

tedious and manual.

 

I was thinking, there must be a way to automate it by

driving Photoshop with a JavaScript so that you could

launch the script from the command line with the

comic book file as input, and Photoshop would find

and save each panel as individual jpeg files.

 

As you can see from the comic book image there is

only white space outside each panel and each panel

has a fairly thick black border so it shouldn't be that

difficult to find each panel in the image.

 

I am not asking for a complete solution, but if

someone could give me a pointer on how to get

started, that would be extremely helpful.

 

Thank You

 

Freddy Jensen

 

TOPICS
Actions and scripting

Views

2.1K

Translate

Translate

Report

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
Adobe
Community Expert ,
Apr 29, 2020 Apr 29, 2020

Copy link to clipboard

Copied

File > Automate > Crop and Straighten Photos

Votes

Translate

Translate

Report

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
New Here ,
Apr 29, 2020 Apr 29, 2020

Copy link to clipboard

Copied

Thank yopu very much!!  It works like a charm.

 

I hope it is OK to ask for one more piece of advise:

When I do "Crop and Straighten Photos", Photoshop

finds all the panels, and opens a cropped image of

each panel.

 

I can then manually do "Save As" for each panel, but

they all have the same file name so I have to manually

change each filename before I save them.

 

It would be nice to have a script that would save each

panel in a seperate jpg file with numerically increasing

names, like:

panel-01.jpg, panel-02.jpg, panel-03.jpg, ... etc.

 

Is there a collection of various JavaScript files somewhere

for driving photoshop that I can look at so I can get an idea

of how to do this?

 

Thanks

Freddy Jensen

 

 

Votes

Translate

Translate

Report

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 ,
Apr 29, 2020 Apr 29, 2020

Copy link to clipboard

Copied

Running the Crop & Straighten script gives me the following:

 

filelist.png

 

One can then use File > Automate > Batch to save the files with unique names:

 

batch.png

 

The result:

 

renamed.png

 

There are other options, such as using Adobe Bridge's Batch Rename tool or using the Image Processor Pro script.

Votes

Translate

Translate

Report

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
New Here ,
May 02, 2020 May 02, 2020

Copy link to clipboard

Copied

Thank you Stephen for helping out.

I tried:  File > Automate > Batch

however I got an error.

I could not select Play Set 11, Action 12. I could only choose

Default Action and "Vignette". I got an error. see attached

screen shots. My photoshop version may be too old perhaps?

It is CS6 (shrink-wrap version).

Screenshot 2020-05-01 18.07.12.pngScreenshot 2020-05-02 07.22.49.png

 

Obviously I am very new to Photoshop. Hope to get better.

 

Thanks

Freddy

 

Votes

Translate

Translate

Report

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 ,
May 02, 2020 May 02, 2020

Copy link to clipboard

Copied

Actions are required by the batch command. You have to make your own. In this case the action is just a means to an end, it shouldn't really do anything.

Votes

Translate

Translate

Report

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
New Here ,
May 13, 2020 May 13, 2020

Copy link to clipboard

Copied

LATEST

Thank You!

Much Appreciated.

Freddy

 

Votes

Translate

Translate

Report

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