Copy link to clipboard
Copied
Hi All,
I take all my photos in 4:3 format. But I also create videos of them in 16:9. So basically I want is a 3x4 showing over the top of a blurred 16x9 photo. Currently the way I do this is
I then position the 3x4 photo on top and give it a white stoke before moving the clear image around and expoting it.
I have attached a screen shot of where I finish, and how I want the image to look.
I do these steps for each photo I want this applied to. I am just asking if there is a way I can set it up so that I can import a photo and have this effect happen without going through as amny steps.
Thank You
Stephen
// place selected images twice, once filling the area and blurred, once with a stroke;
// 2025, use it at your own risk;
var originalRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
// get files;
var theFiles = selectFile (true);
// process files;
if (theFiles.length > 0) {
for (var m = 0; m < theFiles.length; m++) {
var myDocument = app.documents.add(new UnitValue(4800, "px"), new UnitValue(2700, "px"), 72, "newFile", NewDocumentMode.RGB);
var theLayer = plac
...
There is another alternative that doesn’t require any scripts or actions. It depends on some of the newest features in Photoshop, and relies on some quirky inconsistencies in how Photoshop does things. The method shown in the demo below is based on these features, which you’ll have to be familiar with to pull it off:
Copy link to clipboard
Copied
If you want the same image to be the background image, you must use actions or scripts because data-driven graphics do not work with smart object layers.
What you need is a template with two cloned smart object layers. The requirement is that each photo shares the same dimensions and resolution (PPI). Apply a blur to the bottom image inside the smart object, and for the top smart object, just scale, rotate, and apply a stroke layer effect. Replacing the bottom (or either of the two) smart object layers will automatically update the content of the cloned one. You will create a cloned smart object layer by duplicating it using the Duplicate Layer option or Ctrl + J.
The next step is to automate using an action, you need to record an action to use the Replace Content menu item and to open the Open dialog so you can select a replacement image to replace the existing one in the template. Additionally, you can record a step to save the image. It can be further automated but start with above described.
If you are not familiar with actions, I will tag scripters who may already have a similar script to assist you with your task @c.pfaffenbichler
Copy link to clipboard
Copied
// place selected images twice, once filling the area and blurred, once with a stroke;
// 2025, use it at your own risk;
var originalRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
// get files;
var theFiles = selectFile (true);
// process files;
if (theFiles.length > 0) {
for (var m = 0; m < theFiles.length; m++) {
var myDocument = app.documents.add(new UnitValue(4800, "px"), new UnitValue(2700, "px"), 72, "newFile", NewDocumentMode.RGB);
var theLayer = placeScaleRotateFile (theFiles[m], 0, 0, 100, 100, 0);
var theCopy = theLayer.duplicate();
var theBounds = theLayer.bounds;
var theScale = (4800 / (theBounds[2]- theBounds[0])) * 100;
theLayer.resize(theScale, theScale, AnchorPosition.MIDDLECENTER);
gaussianBlur (60);
myDocument.activeLayer = theCopy;
applyLayerStyleStroke(60, 255, 255, 255);
}
};
// reset;
app.preferences.rulerUnits = originalRulerUnits;
////// select file //////
function selectFile (multi) {
if (multi == true) {var theString = "please select files"}
else {var theString = "please select one file"};
if ($.os.search(/windows/i) != -1) {var theFiles = File.openDialog (theString, '*.jpg;*.tif;*.psd;*.png', multi)}
else {var theFiles = File.openDialog (theString, getFiles, multi)};
////// filter files for mac //////
function getFiles (theFile) {
if (theFile.name.match(/\.(jpg|tif|psd|png)$/i) || theFile.constructor.name == "Folder") {
return true
};
};
return theFiles
};
////// place //////
function placeScaleRotateFile (file, xOffset, yOffset, theXScale, theYScale, theAngle) {
var desc5 = new ActionDescriptor();
desc5.putPath( charIDToTypeID( "null" ), new File( file ) );
desc5.putEnumerated( charIDToTypeID( "FTcs" ), idQCSt = charIDToTypeID( "QCSt" ), charIDToTypeID( "Qcsa" ) );
var idOfst = charIDToTypeID( "Ofst" );
var desc6 = new ActionDescriptor();
var idPxl = charIDToTypeID( "#Pxl" );
desc6.putUnitDouble( charIDToTypeID( "Hrzn" ), idPxl, xOffset );
desc6.putUnitDouble( charIDToTypeID( "Vrtc" ), idPxl, yOffset );
var idOfst = charIDToTypeID( "Ofst" );
desc5.putObject( idOfst, idOfst, desc6 );
var idPrc = charIDToTypeID( "#Prc" );
desc5.putUnitDouble( charIDToTypeID( "Wdth" ), idPrc, theYScale );
desc5.putUnitDouble( charIDToTypeID( "Hght" ), idPrc, theXScale );
desc5.putUnitDouble( charIDToTypeID( "Angl" ), charIDToTypeID( "#Ang" ),theAngle );
desc5.putBoolean( charIDToTypeID( "Lnkd" ), false );
executeAction( charIDToTypeID( "Plc " ), desc5, DialogModes.NO );
return app.activeDocument.activeLayer;
};
////// make stroke //////
function applyLayerStyleStroke (theWitdh, theR, theG, theB) {
// =======================================================
var desc12 = new ActionDescriptor();
var ref7 = new ActionReference();
ref7.putProperty( charIDToTypeID( "Prpr" ), charIDToTypeID( "Lefx" ) );
ref7.putEnumerated( charIDToTypeID( "Lyr " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );
desc12.putReference( charIDToTypeID( "null" ), ref7 );
var desc13 = new ActionDescriptor();
desc13.putUnitDouble( charIDToTypeID( "Scl " ), charIDToTypeID( "#Prc" ), 100.000000 );
var idFrFX = charIDToTypeID( "FrFX" );
var desc14 = new ActionDescriptor();
desc14.putBoolean( charIDToTypeID( "enab" ), true );
//desc14.putEnumerated( charIDToTypeID( "Styl" ), charIDToTypeID( "FStl" ), charIDToTypeID( "OutF" ) );
desc14.putEnumerated( charIDToTypeID( "Styl" ), charIDToTypeID( "FStl" ), stringIDToTypeID( "insetFrame" ));
desc14.putEnumerated( charIDToTypeID( "PntT" ), charIDToTypeID( "FrFl" ), charIDToTypeID( "SClr" ) );
var idMd = charIDToTypeID( "Md " );
var idBlnM = charIDToTypeID( "BlnM" );
var idNrml = charIDToTypeID( "Nrml" );
desc14.putEnumerated( idMd, idBlnM, idNrml );
var idOpct = charIDToTypeID( "Opct" );
var idPrc = charIDToTypeID( "#Prc" );
desc14.putUnitDouble( idOpct, idPrc, 100.000000 );
desc14.putUnitDouble( charIDToTypeID( "Sz " ), charIDToTypeID( "#Pxl" ), theWitdh );
var desc15 = new ActionDescriptor();
desc15.putDouble( charIDToTypeID( "Rd " ), theR );
desc15.putDouble( charIDToTypeID( "Grn " ), theG );
desc15.putDouble( charIDToTypeID( "Bl " ), theB );
desc14.putObject( charIDToTypeID( "Clr " ), charIDToTypeID( "RGBC" ), desc15 );
desc13.putObject( idFrFX, idFrFX, desc14 );
desc12.putObject( charIDToTypeID( "T " ), charIDToTypeID( "Lefx" ), desc13 );
executeAction( charIDToTypeID( "setd" ), desc12, DialogModes.NO );
};
////// gaussian blur //////
function gaussianBlur (value) {
try {
var desc4 = new ActionDescriptor();
desc4.putUnitDouble( charIDToTypeID( "Rds " ), charIDToTypeID( "#Pxl" ), value );
executeAction( charIDToTypeID( "GsnB" ), desc4, DialogModes.NO );
app.refresh();
} catch (e) {}
};
Copy link to clipboard
Copied
There is another alternative that doesn’t require any scripts or actions. It depends on some of the newest features in Photoshop, and relies on some quirky inconsistencies in how Photoshop does things. The method shown in the demo below is based on these features, which you’ll have to be familiar with to pull it off:
How I set up the template:
1. With the Frame tool, draw a frame that matches the 16 x 9 canvas size of the Photoshop document.
2. Drag an image from outside Photoshop, and drop it on the frame. It becomes a Linked Smart Object.
3. In the Layers panel, click the left frame thumbnail for that frame, to select the frame (clicking the right thumbnail would select the frame’s contents).
4. Duplicate the frame layer (drag to New Layer icon, or choose Layer > Duplicate Layer).
5. With the frame layer duplicate selected, choose Edit > Free Transform, and adjust its proportions to the other aspect ratio using the Free Transform handles or by entering values in the options bar or Properties panel. (You said 4 x 3, but it looks to me like 3 x 2 so I set mine to 3 x 2.) This is also a good time to make the duplicate frame smaller and rotate it.
6. Make sure the duplicate frame is selected so that it displays frame controls in the Contextual Task Bar. Adjust those as needed; you’ll probably want to use the stroke width and color options (you don’t need to add a separate Stroke effect) and the frame fitting options.
To replace the image in the placeholder frames:
1. Make sure either thumbnail of the duplicate frame is selected.
2. In the Properties panel, click the file path displayed in the Layer Comp section; this opens a menu.
3. Choose Relink to File (or Replace Contents), select your replacement image, and click Place. If it’s a raw/DNG image, Camera Raw opens so click OK there.
4. The replacement image is inserted. Both frames should update with the relinked image.
5. If the replacement image is not properly sized or centered, that means it had a different width and height (in pixels) than the previous image. Use the frame fitting options on the Contextual Task Bar to correct this in just one or two clicks. You’ll probably use Fill Frame Proportionally and Center Content in Frame the most.
Important: In step 2 you might be tempted to replace the image another way, like dropping a new image into the frame or using the Replace Image button in the Contextual Task Bar. But I found that those replace only the image in the selected frame layer. That’s usually OK but in this case you want both frames to update. Clicking the path in the Properties panel to choose Relink to File or Replace Contents is the only way I have found to replace the image in both duplicates in one step. This might be related to Photoshop relinking Linked Smart Objects differently than frame contents.