BatchContentAwareFill1

Content Aware Fill

Quick experimentation attempting to use Photoshop’s Content Aware Fill feature on a video (actually images sequence).

TUTORIAL

USAGE

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.

DOWNLOAD

ContentAwareFill

2.15 KB 3006 downloads

MORE TOOL

Share this:Share on FacebookTweet about this on TwitterGoogle+Share on LinkedIn
  • Aaron

    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?

  • Pingback: Use Photoshop to Get Content Aware Fill on Video with this Content Aware Script()

  • Sliv

    very cool

  • Pingback: Content Aware Fill with Video Using AE and Photoshop | Premiumbeat.com()

  • Danny

    what did he removed? both videos are same?

    • Aaron

      The name of the ship is removed.

  • lodestar08

    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?

  • Steve

    What do i have to do exactly in photoshop to run the script?

  • http://twitter.com/RainbowDemons Klim

    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)

  • David Komer

    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

  • David Komer

    Oh, and to save to PSD, replace saveImageFile with something like the following:

    function saveImageFile(file)

    {

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

    }

  • Denzel

    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.

    • http://www.motionboutique.com/ motion boutique

      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)

  • Dave

    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?

    • Dave

      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…

  • David O

    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:

    http://imgur.com/0DKP5Ls

    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?

    Thanks!

  • Davis

    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)

    • seun s

      am running the photoshop script now but shouldn’t i choose the fill area first or is it after the script is done.

      • Davis

        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.

        • seun s

          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

  • Pingback: Photoshop's Content-Aware on Videos?! | IceflowStudios Design Training()

  • http://www.eyedea.it/ Daniele

    Very nice! Thank you!!

  • Larry O

    I get an error that says…

    Error 21: undefined is not an object

    Line: 132
    -> var comp = app.project.activeItem;

    Any ideas as to what is wrong???

    • Larry O

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

      • Larry O

        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??????

        • Larry O

          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?

          • Larry O

            Also, is there a way to change the shape other than square or rectangle?

  • http://cydialstream.x10.mx/ CydialStream .

    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?

  • Zvi Twersky

    Is there a way to export multiple points so you don’t have to fix, export, and repeat the process?

    • http://www.motionboutique.com/ motion boutique

      No sorry. This script is just an experimentation.