• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
4

Long Winded Self Promoting

Community Expert ,
Feb 03, 2019 Feb 03, 2019

Copy link to clipboard

Copied

I created my Photoshop Photo Collage Toolkit nine years ago and Avoided supporting Templates that need Smart Object layers to be replaced because they need to Distort and rotate images.  Lately there have been some threads in Adobe Photoshop  and  Photoshop scripting forums dealing with updating/populating  products Mockups Templates that have prototype smart object layers that need to be updated to create the output mockup files.  These were good threads and prompted me to do some thinking.  So like my Photo Collage Template design has four simple rules.   I came up with four simple rules for Mockup templates.  I find that I can easily modify Photo Collage Templates and Mockup Template files I download from the web so they comply with my Photo Collage Template rules or my Simple Mockup Template rules.   Mockup templates may be far from simple the only simple part is they are easy to update.  So I have add support to my Photo Collage Toolkit to support Mockup templates.

Simple Mockup Templates

Four Rules

  1. Simple Mockup Templates Only the Smart Object Layer on the top of the Template layers stack will be updated then a Jpeg file saved.
  2. Only Photoshop Objects are support in the top smart objects layers. That is they can not be Object File that are not supported by Photoshop like Camera RAW Files or Illustrator file like .ai, .svg.
    I suggest these objects should be PSD or PSB the Photoshop creates. Avoid using PGN objects in Mockup template use replace content to replace .png  objects with a .psd  which has your png's content.
  3. The first None Smart Object Layer near the top of the layer stack Marks the end of Smart Object Layers the will be updated. Lower Smart Object Layers only update if they share top layers objects.
  4. The Replacement Image Collection need to be in sub folders named obj0, obj1, obj2, .... objN. Each folder must contains the same number of replacement Image files.

Two Scripts

  1. BatchReplaceOneObject.jsx - Only the top Layer in the Layer Stack will be updated it must be a Smart Object Layer replacement images do not have to in a folder names obj0.
  2. BatchUpdateSmartObject.jsx - All top Smart Object layers in the Layers Stack will be updated.
    Replacement Images must be in sub-folders in some folder the sub-folder names must be obj(n) where n is (0,1,2...,v). Folder obj0 for top layer object replacement, obj1 next layer down etc.

Scripts Edit Options

  1. Edit Smart Objects - Replacement images will be sized to fill the layers Smart Object size. However, if the replacement image has a different aspect ratio than the object the fit will be a centered crop.
  2. Rotate for best fit - This Edit option can optionally rotate images orientation for a better fit.  Helpful for picture  package when replacement images files may be mixture of Landscape and Portrait images.
  3. Fit Image - Edit resizes replacement images to fill the smart object canvas size this can crop content like Logo replacements.  Fit Image will not crop, however the smart object canvas will nor be fully covered.
  4. Save PSD File - The updated Mockup will be saved as a Jpeg file use this option to save a layered version as well if you want to be able to edit the populated mockup.

These scripts default operation will use Photoshop feature Replace Content to update the Mockup Smart Object Layers replacement image must be preprocessed so they will have the correct Aspect Ratio, Size and Print Resolution. If you do not prepropcess Image files Replace Content operation may not be what you. So I added Edit options.  If Edit Smart Object is checked the scripts will Edit the Smart Object Layer's  Object instead of using Replace Content. This will take a much  more time them the default operation Replace Content.

MockUp Templates should not have object that are PNG files if you may wan to use the Edit Smart Object options replace any you have with the PNG saved as a PSD file.  Png save performances poor will slow down the Edit option.

Note: These script do not support replacing contents with RAW image files. This is because Photoshop Replace Content feature uses Photoshop place which will open ACR user interface for the RAW image file. This is an interactive interface that is not appropriate for a batch process. Should Adobe change this behavior not open ACR UI, RAW file support can easily be added to the scripts.

The top Smart Object Layer can have their visibility on or off. I would think they would normal be off or have their fill set to zero except in the case of Picture packages. For these layer object are usually shared by other duplicated layers that are visible and can be anywhere in the layers stack. These layers will position, size and may distort the object for what is need in the mockup.  Useful in templates for Picture packages and product mockup like T-Shirts  where image need to be Framed, distorted be warped, rotated, perspective or have other distortions added.

In any case Replacement object files need to be exactly the same size as the object being replaced. That is have the same number of pixels in the image's width and the same number of pixels in the image's height and have the same print resolution as the object stored in the mockup template. So place will create the same size object. Every Smart Object layer has an associated transform for the created smart layer to transform the layer to size for the document. A Smart object layer's associated transform is not replaced or changed when you replace the a layer object. If your simple mockup template has three smart object layers that share the replaced object. There are three different associated transform for the single replaced object.

Comparison between Photo Collage Templates and Simple Mockup Templates

I do not use replace Smart object contents populating collages templates because of object replacements restrictions. However, when image need to be  distorted be warped, rotated, perspective or have other distortions added. Then using a smart object replacement is the way to go but preprocessing replacement images is required. Therfore only mockup template require that all replacement images be  preprocessed. So they will populate correctly.  Replace Smart Object Layers content uses Photoshop "File Place Image" feature. Photoshop Place feature is weird and IMO not design well.  For it may resize your image for the layer and it may scale the smart object layer created to fit on canvas. I do not mind that it may scale the smart object layer to fit on canvas depending on how you have you preference set.  The wording of the preference is miss leading. For No matted how the setting is set Place may resize your image when it creates the smart object layer. Place may also scale the smart layer created to fit on the documents canvas depending on preference setting and the size of the object layer  created. However I do mind Photoshop resizing my image creating the smart object layer for this will looses some image quality.  For some unknown reason to me if the file image being places in print resolution setting is different then the open document print resolution setting Photoshop will resize you image which degrades its quality.  IMO that resize is bogus it should not be done.  Duplicating a layer into an other document, dragging and dropping layers between document and copying and pasting between document does not resize why in the world does place. So be careful Templates and the replacements place files should all have the same print resolution for best results. Required for Mockup replacement and for best Photo collage image quality

Photo Collage Templates support 1 to 53 image placement areas. All images will be placed in above the required Background layer. Images are populated from the bottom up.  Named Image numbered Alpha channels are required to map the location, size and shape of images the will be placed into the collage.   Image files can be any size stored in any support image file format for best  best image files aspect ration should be nearly the same as aspect ratios of the mapping alpha channels they the will be place in for.  Image file and template file should have print DPI resolution that match to keep Place from degrading placed images.   Any Photo Collage Template can be populates as Picture Package all image location will be populated with independent smart object layers containing the same image.  High overhead but image need not be preprocessed and RAW image can be place in.

Simple Mockup Templates Mockup Templates are populated from the top down using Replace content for the layers stack top Smart Object layers. Smart Object Layer content replacement requires all replacement images to be preprocessed so they will have the same aspect ratio, size and print DPI resolution as the Object that they will be replacing.  This can easily be done batching an action with Adobe Image Processor script.  The Image Processor would save the processed image to a replacement image folder like obj0. All the action needs to do is use image size without resample checked to set the correct print DPI resolution. if you will be populating a picture package mockup created for landscape images optionally rotate portrait orientated image to landscape orientation using one of my utility scripts for action. Use my Aspect Ratio Selection plug-in script to set a centered maximum size aspect ratio selection. Then use image crop followed by an Adobe Fit Image plug-in step to resize the image to have the correct number of pixels in its width and height. Populating a Picture Package Mockup template will be faster and have less overhead than populating a Photo Collage Template as a picture package.  However, before you can batch populate a Picture Package Mockup template you first must batch process your replacement images to match the mockup object Aspect Ratio, Size and Print DPI resolution.

A smart object layer Object file  Has an aspect ratio, size and print resolution.  Print resolution is important because of Photoshop feature File Place feature has a strange implementation. Because each Smart Object Layers may have a different size I need a way keep layers replaces separated from each other and associated to a particular smart object layer.  Thus a folder for each layers replacements objects.  Computers, Programmers, and Photoshop start counting from zero naturally so does my script via replacement folder names obj0, obj1, obj2, ... objN these names are relative to Photoshop Layer stack.  That "obj0" is top of the stack "obj1" next layer down and so on.   These scripts make no attempt to verify that file in the folders are the correct Aspect Ratio size and resolution for the object being replaced.  If you files are not correct Photoshop replace content will not work correctly.  So I added and Edit options to the scripts. These script can Edit Photoshop Smart object layer objects instead of using Replace Content. To try to fit the image in the folder to the object to fully fill the object. I also added a rotate option to rotate orientation for best fit. Could be useful for pictured package mockup where a mixture of Landscape and Portrait image will be populated. Because filling the object canvas may crop some image content I add an Edit option fit image which will fit the image to the object canvas no cropping will occur. Useful  when you do not want things like Logo cropped. These scripts also make no attempt to get a correct set of image into the template it simply processes the files the obj(n) folders in file system sort order. Since each layers replacements are in separate folders  each folder can have a set of file names that match the other object folders.  Each object folder could have identical file name sets for each mock output file. MockUp0Name, MockUp1Name, MockUp2Name,... . These Batch Mockup Smart Object Scriptsare simple and dumb to minimize complexity and execution time.  You the user have the brains.  Create the file sets so they will work. Using Edit Smart Object option is a much slower process than these scripts default operation Replace Content. To use the options Rotate for best fit and Fit Image you must also check Edit Smart Object. You will have time to drink some wine.

Option Save PSD File can be user when using the Replace Content default operation and when using the Edit Smart Object option.

Simple Mockup templates are harder to create than Photo Collage Templates but can support image transforming that includes  warping, rotation, perspective, etc and smart filters like distort displacement.  Image Distortion is not something that can be automated with my four rule Photo Collage Template design only layer above the background layer can be blended into placed images.

 

[Link is no longer valid and has been removed]

 

JJMack
TOPICS
Actions and scripting , Windows

Views

1.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , May 12, 2022 May 12, 2022

Sorry to inform you, but JJ recently passed away. We will all miss his contributions to this forum.

Votes

Translate

Translate
Adobe
Advisor ,
Feb 03, 2019 Feb 03, 2019

Copy link to clipboard

Copied

Hi, JJMack, Thanks for sharing this. I started doing photo collage as soon as I got Photoshop. I think it was the suite - Illustrator, Photoshop and Indesign. Long ago. Looks as though you had a lot of fun too.

Miles and smiles forever. Regards, JH

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 05, 2019 Feb 05, 2019

Copy link to clipboard

Copied

Wow Photoshop can use up RAM and scratch space quickly running this script. I created a mock the has 9 Smart object layers that get updated and create 9 populated mockups. So only 81 files were populated.  The files list for all the files paths should only requires about 20K. Only one document is open 9 small jpg images get placed in via Replace smart object layer content then a jpeg this  was repeated  8 more time.  Photoshop Quickly allocate the 35GB of RAM I set as the max it can use then proceeded to eat up an additional 86GB of scratch space before the job was done and it took a long long time. I think the may be issues with replace content. Photoshop seems to be using more resources then it should need to.

JJMack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 08, 2019 Feb 08, 2019

Copy link to clipboard

Copied

Solved my Performance Problem.

The Performance of replace Content was very poor and unexpected. I have my Preferences set to keep up to 100 History states.  When I batch a mockup with large number of replacements images I found this caused Photoshop to use all my systems Rams. I configured Photoshop to be allowed to use 30GB of RAM my system has 40GB. After Photoshop utilized all the RAM it can Photoshop started using use a lot of extra scratch space.  So I restructured my script to suspend-history processing mockup templates. The Performance improved outstanding.

The test case I used was a Collage type mockup that has 9 smart Object layers update. Either by Replace Content or Edit Smart Object. There were a total of 81 images which produced 9 output Jpeg files.

The Photo Collage is a simple collage template with no smart object layers. It just get 9 smart object layer placed in sized, positioned and shaped. Distortion is not supported, warping,rotation, perspective etc. This is done on a duplicate document so only collages with a large number of image would create too many history states to manage in ram on my 40GB workstation.

When a batch Mockup script is run in its default mode (Replace Smart Object Content). You will see little or no activity in the History Palette and Layers Pallet. You may think the script is hung. It is not you can monitor the output folder and see output jpeg files being saved.  When run in Edit Smart Object mode you will see much activity in the palettes. Also Photoshop Image Window updating may not be what you expect.

CS6 and CC 2019 Performance is about the same  CC 2014 seems somewhat slower.

JJMack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 12, 2022 May 12, 2022

Copy link to clipboard

Copied

Hi JJMack, Thank you for your generous contributions on this forum. They are immensely helpful to me as I learn more about Photoshop, JavaScript, and ExtendScript. I'm working on my first paid project and I would never be able to complete it without the information and examples in posts made by you and other skilled forum members.

 

I just ran across this thread and am very interested in the Photo Collage Toolkit you posted a link to, but it's been a couple years since that post and I'm getting an error when I try to load the page at: 

http://www.mouseprints.net/old/dpr/PhotoCollageToolkit.html.  Do you happen to have it posted anywhere else where I can download it?

 

Thank you for your assistance!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 12, 2022 May 12, 2022

Copy link to clipboard

Copied

Sorry to inform you, but JJ recently passed away. We will all miss his contributions to this forum.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 12, 2022 May 12, 2022

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 12, 2022 May 12, 2022

Copy link to clipboard

Copied


@Happy Doorway wrote:

I just ran across this thread and am very interested in the Photo Collage Toolkit you posted a link to, but it's been a couple years since that post and I'm getting an error when I try to load the page at: 

http://www.mouseprints.net/old/dpr/PhotoCollageToolkit.html.  Do you happen to have it posted anywhere else where I can download it?


 

As noted, JJMack is sadly no longer with us. One of his family members mentioned that they would provide an online repository, once they had "tidied things up" a bit.

 

Until that happens you can access copies that I downloaded here:

https://github.com/MarshySwamp/JJMack-Archive

 

I will of course remove this repo if requested by the family, it is just there as an interim public service.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 15, 2022 May 15, 2022

Copy link to clipboard

Copied

LATEST

I'm still sad that JJ's not with us anymore. Loved his input. Such a huge loss for the community.  😞

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines