Copy link to clipboard
Copied
The image used for replacement has a PPI different from the PPI of the smart object content, causing it to shrink noticeably after replacement.
Can you explain the relationship between the smart object layer and its content, and the underlying principles? I have a solution to convert the image's PPI to match the PPI of the smart object content. Is this feasible?
psd ,ppi=300
smart object content ppi=72
Replacement Image 1 ppi=72
\
Replacement Image 2 ppi=300
Right-click and select "Replace Contents," then use a replacement image with PPI=72. The replacement works as expected.
Right-click and select "Replace Contents," then use a replacement image with PPI=300. The replacement results in noticeable shrinkage.
Copy link to clipboard
Copied
If a replacement image has a different PPI, Photoshop will silently match the PPI to the parent document in the background without any notification. Matching PPI can cause (and actually always does) the imported image to change its dimensions because this silent adjustment alters the resolution with Resample turned on.
For example:
The parent document is 3000x2000px at a resolution of 72.
The replacement image is 3000x2000px at a resolution of 300.
The imported image will be 720x480px because Photoshop silently changed the resolution from 300 to 72 in the background to match the parent document resolution (with Resample in the Image Size on).
There are a few solutions:
Copy link to clipboard
Copied
What does "The parent document" refer to? Is it the outermost PSD file, or the document opened after editing the content of the smart object layer? Which one are you referring to in my question screenshot? Is it the "psd, PPI=300" or the "smart object content, PPI=72"?
Copy link to clipboard
Copied
Parent is an open document containing the image that needs to be replaced.
The explanation above, under "For example" pertains to the situation depicted in the screenshot below.
Copy link to clipboard
Copied
I am using a script to replace the content of a smart object layer, so I need to confirm: should the PPI of the replacement image match the PPI of the PSD or the PPI of the smart object layer's content?
Copy link to clipboard
Copied
Match the dimensions and resolution of the smart object content in this case. I assume you have pre-made replacement content that matches the dimensions but does not match the resolution of the image within the smart object layer.
You can also batch change the resolution to align with the template resolution, then recreate the smart object.
Copy link to clipboard
Copied
Thank you very much for your patient explanation.
Copy link to clipboard
Copied
The current logic for obtaining the PPI of a smart object layer's content is: 1. Edit the content, 2. Retrieve the PPI. This requires the smart object content to be opened within Photoshop. If it cannot be opened, such as in the case of an .ai file, how can the PPI be obtained in such scenarios?
Copy link to clipboard
Copied
I am using a script to replace the content of a smart object layer
By @li27112570w0z3
The script could have an extra conditional check added to change the PPI value of the replacement image to match the original smart object..
Copy link to clipboard
Copied
The basic rule is that smart objects honor the physical print size, not the pixel size.
The print size is determined by the ppi value. That's why ppi numbers need to match throughout if sizes are to be consistent. If either the parent document or any of the embedded child documents have different ppi numbers, there will be resampling to get sizes to fit accordingly.
In short, smart objects make pixel images behave the same way as PDF or vector files.