Mobile app version of vmapp.org
Login or Join
Alves566

: Photoshop action: how to make a crop (menu item) in an action without deleting pixels? Editing the atn file? I am working on a workflow to make an auto crop. I have an action set up with

@Alves566

Posted in: #AdobePhotoshop #PhotoshopScripting

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

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Alves566

2 Comments

Sorted by latest first Latest Oldest Best

 

@Sherry646

@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) :



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.)



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:



And after reopening and choosing the Crop Tool again:



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

Hope that helps you out...

10% popularity Vote Up Vote Down


 

@Ogunnowo857

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:



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

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme