1

I am working on a workflow to make an auto crop. I have an action set up with an automatic selection (magic wand), a little expansion of this selection and a crop to this selection. To make a crop based on a selection, you have to use the menu item 'Image' > 'Crop'. But it seems impossible to perform this crop without deleting the pixels, although this is an option when using the crop tool.

Many people on many fora said: a crop is made when you want to delete pixels, so what's the fuss all about? Well, I know that there will be errors when I perform a batch action of this workflow. This isn't a problem, because I can perform a quick visual check afterwards and correct images if needed. But for this to be possible, I need the crop to be non-destructive.

Workarounds already tried:

  • First make a smart object of the image. The problem: you get huge files that are hard to work with.
  • Change the action manually: within the action, there seems to be an option to the crop function (still menu item): "With Delete Cropped Pixels". Yet, when you double click on it, you are not able to change this 'option'. So I went a step further and tried to change the script of it. Using this and this tool, I converted the .atn file (export of the Ps action) into an editable xml, and changed it back to an .atn file to open it in Photoshop. In the xml file, there seemed to be an interesting piece of code:

    <ActionItem key="TEXT" expanded="true" enabled="true" withDialog="false" dialogOptions="2" identifier="TEXT" event="crop" name="Crop" hasDescriptor="true">
    <ActionDescriptor key="crop" count="2">
      <DescValueType.BOOLEANTYPE key="1147958304" id="1147958304" symname="Delete" sym="Dlt " boolean="true"/>
    </ActionDescriptor>
    

This seemed related, so I changed the boolean="false" into "true". It had a certain effect: once opened in Photoshop, the action showed "Without Delete Cropped Pixels" underneath Crop. Unfortunately no luck: the crop was still performed with a deletion of the pixels. Furthermore, when I performed the action step by step, the option changed again into "With Delete Cropped Pixels".

So now I wonder: is it only possible to change the appearance of this option, or is there a real option to perform the crop within an action without deleting pixels.

Other workarounds are also always welcome.

Thanks for the support

2 Answers 2

0

I was trying to do what you want using an action but then I thought:

Workaround:

Rather than worry about cropping non-destructively or editing actions - why not just save your edits as a copy when running the batch? Just choose 'Folder' as your destination:

Batch Dialog Box

Then if there are errors you'll still have the originals right?

If all is good with your crops you then can just delete them

7
  • Yeah, I actually did that at first as well. But then, I found out it's quite a hassle to first find the files with errors, noting the names of the files and copy pasting the corrected ones. Would be easier to just edit the files, right in the same folder.
    – stijndg
    Commented Jun 4, 2017 at 19:06
  • Can you just save your crops out as a copy right beside the originals? Then you could inspect them, if there was an issue just delete the copy and edit the original again. What sort of files are you dealing with anyway? PNGs and then you're saving them to PSD or what? Are you running your action and then saving them or are you just running the action and then inspecting the results without closing Photoshop? Need more information
    – BANG
    Commented Jun 6, 2017 at 5:38
  • I work with TIFF files, destined for long term preservation. We create them in Adobe Lightroom with tethered capture (which gives us NEF files, the Nikon RAW format, that we then export as TIFF). In this process, they immediately get the right names, which are quite complex. The context is digitization of dossiers, containing multiple kinds of documents. The names are logically build up, but quite long, f.e. 200609136_doc001_1 for dossier 200609136, document 001, page number 1. If we have to add to this file name, I'm afraid of mistakes later on. Maybe we could add "_crop" to the end.
    – stijndg
    Commented Jun 7, 2017 at 11:22
  • My workflow for the moment is - producing the photos - checking them in Bridge - in general, it is easy to notice if a crop was wrong, even without a full screen view - only open a photo in photoshop if I think that the crop is wrong - change the crop. Opening the TIFF files in Photoshop isn't always lightning fast, so I only want to open them to correct something. For checking them, the preview in Bridge should suffice. The names of the files are very important. I'm afraid that when we have to create doubles, it will be more difficult to be sure we maintain the right ones.
    – stijndg
    Commented Jun 7, 2017 at 11:30
  • Wow. Those are some loooooooooong filename you've got there! There is room to shorten those up too... Spaces and commas in filenames are not a great idea either I don't think. I would want then more like: 200609136_doc001-1_4-doss_200609136_pg-01. That knocks 29 characters off right there (or 20 characters if you really need to list "doc001" twice like that)... Just food for thought
    – BANG
    Commented Jun 8, 2017 at 7:12
0

@stijndg

After reviewing your comments, I believe I have solved your issue.

I made a simple test image and saved it as a TIF.

I tried to do what you want and I found you just need to change your action up a bit.

In your original question you said the following:

To make a crop based on a selection, you have to use the menu item 'Image' > 'Crop'.

Here's your problem. That isn't true. That is one way to do it but it's not the only way...

So here is my test image (this is not the TIF I made just a PNG copy for demonstration purposes here) :

Test 1

I put two smaller circles outside the bigger one and made them transparent enough so they wouldn't affect the Magic Wand selection but so I could still see them.

Then I recorded my test action in which I made a selection using the Magic Wand, then inverted the selection. Next I expanded the selection.

Now here when recording your action, rather than going to Image > Crop - which is (as you've discovered) very much destructive - instead just switch to the Crop Tool. It should immediately snap to your selection, then just hit Enter a couple of times to accept the crop. (Here make sure Delete Cropped Pixels is unchecked.)

Test 2

That should be the only change you need to make to your action. In my test I was able to run the action and crop to the red circle, save and close the file completely, then reopen the image and the two blue circles I saved were still there. Cropped:

Test 3 - Cropped

And after reopening and choosing the Crop Tool again:

Test 4 - Still there

A little hard to see because of the crop overlay but the blue circles were still there.

Hope that helps you out...

4
  • Thanks for the trick. I tried something like this, but wasn't able to record the crop tool being selected. Will certainly try this again, if you say it's possible.
    – stijndg
    Commented Jun 15, 2017 at 12:24
  • 1
    I should also have noted that I am using the 2017 version of Photoshop... About older versions I'm not sure. I did notice an option with the Actions Panel labeled 'Allow Tool Recording'. Perhaps this is necessary in older versions.
    – BANG
    Commented Jun 18, 2017 at 20:03
  • @stijndg If you found this answer useful please vote it up. If this has answered your question, please mark it as such so it will be removed from the 'Unanswered' page. Cheers
    – BANG
    Commented Jul 2, 2017 at 4:16
  • I finally arrived at testing this again. I succeeded in recording the crop tool in CS6, but in the action, the crop is based on a fixed area instead of the selection I made during the action. (You can actually see this when you pop open 'Crop' inside the action.) How is this in your action? Is it always cropping the same area, or is it really cropping another area when using another image?
    – stijndg
    Commented Aug 14, 2017 at 15:14

Your Answer

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

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