You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hello
i am doing same thing , i tried both of your codes, but in my case i am using exactly same image as layer holder,
when i manually do this in photoshop it works fine(i dont have to do any placement because it is exactly as same pixel as layer), but when i do it through the code, the photo becomes more wider than i thought
code i used --
with Session(mockup, action="open",auto_close=True) as ps:
active_layer = ps.active_document.activeLayer
bounds = active_layer.bounds
# in this segment we are getting the frame of mockup, then we use
# our function to adjust the image within given pixel without distortion
width = int(bounds[2] - bounds[0])
height = int(bounds[3] - bounds[1])
adjust_image()# i replace my image here with same width and height as layer
replace_contents = ps.app.stringIDToTypeID("placedLayerReplaceContents")
desc = ps.ActionDescriptor
idnull = ps.app.charIDToTypeID("null")
desc.putPath(idnull, 'img.png')
ps.app.executeAction(replace_contents, desc)
ps.active_document.saveAs(f'res.jpg', ps.JPEGSaveOptions())
i am attaching results for reference -
using code -
manually -
mockup file i used - link
hello
i am doing same thing , i tried both of your codes, but in my case i am using exactly same image as layer holder,
when i manually do this in photoshop it works fine(i dont have to do any placement because it is exactly as same pixel as layer), but when i do it through the code, the photo becomes more wider than i thought
code i used --
i am attaching results for reference -
![using code](https://user-images.githubusercontent.com/84266613/231948456-a388ec1d-7488-4e09-9ef0-465f7a5eaa2e.jpg)
![manual result](https://user-images.githubusercontent.com/84266613/231948636-467c7f1d-3c08-4a1b-9769-6e85185cc37c.png)
using code -
manually -
mockup file i used - link
Originally posted by @chetan-SMRI in #38 (comment)
The text was updated successfully, but these errors were encountered: