Skip to main content
Participant
April 29, 2020
Question

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

  • April 29, 2020
  • 1 reply
  • 2414 views

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

 

This topic has been closed for replies.

1 reply

c.pfaffenbichler
Community Expert
Community Expert
April 29, 2020

File > Automate > Crop and Straighten Photos

Participant
April 30, 2020

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

 

 

Stephen Marsh
Community Expert
Community Expert
April 30, 2020

Running the Crop & Straighten script gives me the following:

 

 

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

 

 

The result:

 

 

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