0
\$\begingroup\$

I have had several hundred old negatives scanned by a local company. I am happy with the quality, but have found they are using a flatbed scanner to scan each strip, and then manually cropping each negative to remove whitespace.

Is there a batch script (PhotoShop etc) that would be smart enough to remove this whitespace from a folder of scanned images? The files each contain a single photograph rather than a strip of 4 side-by-side, however each may have one or two sides with a black edge.

For example (and not the easiest to see here) there is a white border top an bottom and black to the left and right edge:

enter image description here

Update - Thank you for the answers so far. To add a little more detail, the images are not always the same size (dimensions) and the borders can vary depending on the position of the image on the strip of negatives (first, middle 2 or last).

\$\endgroup\$
6
  • \$\begingroup\$ Trim… ought to work, used twice it should first strip the white, then the black. Save these 2 passes as an Action, which you can then use to Batch. Oddly, I've tried it on this shot & it fails to trim all the white, then goes no further. I haven't a clue what's preventing it. \$\endgroup\$
    – Tetsujin
    Mar 1, 2022 at 9:49
  • \$\begingroup\$ Crop & Straighten seems to work better... \$\endgroup\$
    – Tetsujin
    Mar 1, 2022 at 10:08
  • \$\begingroup\$ @Tetsujin, as you can see the borders have transition, they are not flat colour: i.imgur.com/yl8PgpR.jpg \$\endgroup\$ Mar 1, 2022 at 10:16
  • \$\begingroup\$ @RomeoNinov - yup, but it wasn't even getting that far. \$\endgroup\$
    – Tetsujin
    Mar 1, 2022 at 10:19
  • 1
    \$\begingroup\$ @Tetsujin, I count there more than 300 colours \$\endgroup\$ Mar 1, 2022 at 10:21

4 Answers 4

1
\$\begingroup\$

For only a few hundred images, I would just get it done manually.

Cropping is simple and unlike debugging code, it’s constant progress work which handles edge cases.

And since I am lazy, I would only crop images when they needed cropping. Images need cropping only when used for something that requires cropping.

Sitting on disk is not one of those uses.

\$\endgroup\$
0
\$\begingroup\$

You can Batch process any function you can make into an Automator Action.

I discovered Trim wasn't going to work, but Crop & Straighten was reasonably successful.
If all the images are actually the same size inside the 'spare' black/white border, then you could conform them all with a very slight crop to 1800x1200 px [or appropriate to the size of your originals].

enter image description here

Once recorded [& tested] as an Action, you can then use it to set up a Batch process.

\$\endgroup\$
2
  • \$\begingroup\$ I think this is likely similar to Romeo's suggestion - unfortunately the images are not the same dimensions. I will look into "trim", but does this remove borders using some sort of colour threshold? If so, it does sound like it would be the right tool. What happened in your tests? \$\endgroup\$ Mar 1, 2022 at 11:09
  • \$\begingroup\$ Crop & Straighten is 'smart' it will find the image wherever it is & trim it [better than Trim is doing on this pic]. The crop afterwards is optional, I found on this one image it just left a few white-ish pixels on one edge & Crop fixed it. [Crop itself is 'dumb' of course.] \$\endgroup\$
    – Tetsujin
    Mar 1, 2022 at 11:13
0
\$\begingroup\$

If the size of borders are the same over all the images you can use XnView function crop.

  • select images to be cropped
  • Tools -> Batch Convert
  • in Actions add Image->Crop
  • select the numbers as from the image below (you can tune them further if you want) enter image description here
  • in Output select target directory where the result files will be stored (different from source directory)

P.S. This method work independently of the size of the images.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Thanks for your answer. I will update the question, but unfortunately the images and borders are not fixed sizes. Some images don't have the same borders as they may be from the start/end of the strip of negatives. \$\endgroup\$ Mar 1, 2022 at 11:02
  • \$\begingroup\$ @AlexanderHolsgrove, let keep the answer, maybe will be helpful to someone else :) \$\endgroup\$ Mar 1, 2022 at 11:04
  • 1
    \$\begingroup\$ Yes please do - I wish this had been the case for me as a fixed croup would be a nice easy fix! Thanks again for your answer and I do hope it helps someone else \$\endgroup\$ Mar 1, 2022 at 11:06
0
\$\begingroup\$

If the negatives were all the same size, and the enlargement ratio is the same (e.g. all direct contact scans at 1200dpi), then you can create an action using the "Image > Canvas Size" function in Photoshop.

I made a screen shot of the image you posted and it's overall size was 1402x965 as shown in the first image (but that part is irrelevant).

I then measured the area the negative occupied with the rectangle shape tool and found it was a little over 1255x828; but those are the dimensions I used because the image has a slight rotation to it... this is where you would have to compromise and select the largest rectangle size that will fit the rotations/displacements of all of the scans.

I then set the canvas size to 1255x828 with the anchor point in the middle, a warning pops up that image clipping (trimming) will occur, select ok/proceed. The last screen shot is the result (with PS's UI drop shadow; it's not part of the image). I would also have them saved out as a new file so any that are not acceptable can be redone manually. enter image description here

You could start your action with "File > Automate > Crop and Straighten Photos" if necessary... it might get you a more consistent starting point for the canvas clipping.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.