Participating Frequently
July 22, 2025
Question
How to disable AutoTrim when importing a PNG image with transparent pixels around its perimeter?
- July 22, 2025
- 1 reply
- 322 views
How to disable AutoTrim when importing a PNG image with transparent pixels around its perimeter?
When I place a PNG image in Photoshop, it will automatically trim the transparent pixels on its four - sided perimeter, as depicted in the attached illustration. How can I disable this feature? I am developing a plugin with UXP to convert Figma files into PSD files, and this feature poses a problem for me in achieving perfect image alignment.
Here is the code I am using:
await core.executeAsModal(
async () =>
batchPlay(
[
{
_obj: 'placeEvent',
null: {
_path: token,
_kind: 'local',
},
freeTransformCenterState: {
_enum: 'quadCenterState',
_value: 'QCSCorner0',
},
offset: {
_obj: 'offset',
horizontal: { _unit: 'pixelsUnit', _value: 0.0 },
vertical: { _unit: 'pixelsUnit', _value: 0.0 },
},
_isCommand: true,
_options: {
dialogOptions: 'dontDisplay',
},
},
],
{}
),
{
commandName: 'import image file',
}
);Thanks!
