Quick experimentation attempting to use Photoshop’s Content Aware Fill feature on a video (actually images sequence).
1. Open a video in After Effects and export it to a sequence of images
2. Using AE’s Tracker, track a point through the sequence
3. Select the track point, and execute the script posted below
4. Open Photoshop CS5 or CS6, and run the script ‘psBatchContentAwareFill.jsx’ created in step 3
Free material license
These scripts are copyrighted by Motion Boutique.
They are free for personal and commercial use but come “as is” with no warranty nor any free personal support.
Redistribution in any form is not allowed, instead always link to www.motionboutique.com for correct files.
By downloading any of these scripts, you agree the above terms.
39 thoughts on “Content Aware Fill”
This works really well. Is there a way to custom input a selection size or area with the PS script that you generate?
Also, this only works with the traditional AE tracker, correct?
what did he removed? both videos are same?
The name of the ship is removed.
not working for me: keeps filling in an area that is not even close to my track point. what do you think I’m doing wrong?
What do i have to do exactly in photoshop to run the script?
This is bloody amazing! Thanks so much!
(For others, note that the script created in #3 is saved in your AE scripts folder, I didn’t realize this immediately)
Very cool. Note that it currently doesn’t support .PSD files. This is easily fixed by adding that case around line 110 or so (i.e. || files[i].name.toLowerCase().indexOf(“.psd”) != -1
Oh, and to save to PSD, replace saveImageFile with something like the following:
var idsave = charIDToTypeID( “save” );
var desc9 = new ActionDescriptor();
var idAs = charIDToTypeID( “As ” );
var desc10 = new ActionDescriptor();
var idmaximizeCompatibility = stringIDToTypeID( “maximizeCompatibility” );
desc10.putBoolean( idmaximizeCompatibility, true );
var idPhtthree = charIDToTypeID( “Pht3” );
desc9.putObject( idAs, idPhtthree, desc10 );
var idIn = charIDToTypeID( “In ” );
desc9.putPath( idIn, file );
executeAction( idsave, desc9, DialogModes.NO );
Thanks. That script would solve a problem i have. I just can’t figure out what to do when I get in Photoshop. Do I have to load the sequence and then apply the script, or just execute the script? (either way nothing happens when I try). What’s the sequence of action when I’m in Photoshop? Thanks again. Great job.
that comment from Klim may help : (For others, note that the script created in #3 is saved in your AE scripts folder, I didn’t realize this immediately)
I haven’t tried this script yet, but I’m curious how to define the area for the content aware fill. Is this defined by the larger search area box or the smaller tracking box shape in AE’s tracker?
Now that I think about it, the area I asked about is probably defined by the area selected while in Photoshop and the AE tracking is just to keep things tracked. Silly me…
I’m doing something wrong. If someone could make a more detailed step by step, or even a tutorial, that would be awesome!
When I’m running the script in After Effects I’m supposed to select this right:
Do I have to put the script in the same folder as the image sequence?
When I run the script in Photoshop, nothing happens. Is it supposed to run the batch automatically?
I’ve made it to Step 4.
It gives me the error message, “could not content aware fill, requires selection”
error occurs on line 79
My guess is this happens because my tracking point starts off screen.
(just modified my tracking point to stay on screen and it works)
am running the photoshop script now but shouldn’t i choose the fill area first or is it after the script is done.
The fill area is based on your After Effects trackers region of interest; I haven’t figured out how to make custom selections other than modifying that and running the AE script again.
thanks my clip was 45mins long. have just stopped it to redo the track points in ae and only export out 5mins see how the content aware fill works
Very nice! Thank you!!
I get an error that says…
Error 21: undefined is not an object
-> var comp = app.project.activeItem;
Any ideas as to what is wrong???
I guess I couldn’t see the file name correctly on the PS File Browse point. Didn’t see batch in name. It’s doing something now. 🙂
I see that the CONTENT AWARE is not following what needs fixing. Do I need to make keyframes for the track box for it to know what to follow??????
Okay so I keyframed the spot I wanted to be repaired. When I go frame by frame I see it track with the selected spot. However in Photoshop it is not tracking. Any ideas?
Also, is there a way to change the shape other than square or rectangle?
Photoshop CS6 (64-bit) doesn’t seem to run the script. When I load it the load window just closes and leaves me with Photoshop with nothing loaded. Any ideas?
Is there a way to export multiple points so you don’t have to fix, export, and repeat the process?
No sorry. This script is just an experimentation.
Would this work in the Creative Cloud
You mean with ae CC? yes it should!
Any idea about what I’ve got wrong.
Was there an answer to this? I have the same issue
Where can we download the photoshop part of the script “psBatchContentAwareFill.jsx”? – doesn’t appear to be packaged with the AE script for exporting.
It is created by the script inside AE.
Is it possible to use this script using masks?
Since the tracker is only square shaped…
Script no longer works in CC 2017.. bummer.
When you reach that part of the instructions that tell you to save an image sequence of what you’re gonna track and remove :
=====> Make sure you click on the little down arrow next to the name of the file to be rendered (highlighted in blue) in the “destination” section of the render queue, which will bring up a floating menu.
=====> Then, just click on first option, namely “name of the comp” (or whatever it is called in english), which will rename the sequence you are exporting to the actual comp name (maybe avoid any “!” “?”, etc., [in short any symbol windows does not like in a file/folder name] in your comp name in the first place, just in case).
=====> Now click on that sequence to be rendered (the blue thingy) and choose the rendering location (it is advised to create a new folder in which to save those JPEG files so you don’t find yourself with possibly a hundred of them scattered everywhere :))
=====> Once this done, simply hit the render button and follow the remaining instructions of the video (without forgetting to point to that folder when the script asks you to choose the folder containing your sequence of images).
It is all a matter of folder names (well, for me it was, and now problem is solved). And it WORKS in After Effects 2017 (currectly using it). Anyway, just follow EXACTLY what the person in this tuto is doing and you won’t have any problem (in the video you can see that that little arrow is clicked onto, just like described above.
Comments are closed.