How to preserve warp mesh deformation when updating Smart Object content in PSD using Aspose.PSD for .NET

We are working with .psd files that contain Smart Object layers with warp mesh deformation (non-linear mesh warp). We would like to automate image replacement inside these Smart Objects, and ensure that the existing warp deformation remains applied to the new content.

We are considering two possible workflows:


Case 1: Linked Smart Object

  • The Smart Object in the .psd is linked to an external .psb file.
  • We programmatically open the .psb, replace its content, and save it.
  • As a result, the .psd automatically reflects the updated content from the .psb.
  • Our expectation: the existing warp mesh in the .psd should still apply to the new content from the .psb.
  • We then export the final .psd as .png.

Case 2: Embedded Smart Object

  • The Smart Object is embedded directly inside the .psd.
  • We programmatically update or replace its content inside the .psd.
  • Again, our expectation is that the existing warp deformation is preserved and applied to the new content.
  • The final .psd is exported as .png.

Our questions:

  1. Are these two workflows currently possible using the existing Aspose.PSD for .NET functionality?
  2. If yes, could you please share a general approach or code sample showing how to:
  • Replace content inside a Smart Object;
  • Ensure the warp mesh deformation remains intact;
  • Export the final .psd with deformation applied.
  1. If not currently possible, would you recommend submitting a feature request or escalating to Paid Support?

We’re happy to share sample PSD/PSB files if that helps illustrate the case.

Thank you for your guidance and support!

@Alexeymkr

As the quick answer - both approaches are supported by Aspose.PSD, but the warp deformation implemented different in Aspose.PSD, we are actively work to make it’s more similar to the original Photoshop rendering.

  1. For the linked and the embedded images: SmartObjectLayer.ReplaceContents | Aspose.PSD for .NET API Reference
  2. Using warp transformation: https://docs.aspose.com/psd/net/how-to-use-warp-in-aspose-psd/

Please note, that for the rerendering with warp should be used PsdLoadOptions with AllowWarpRepaint property set to true:
using (var psdImage = (PsdImage)Image.Load(sourceFile, new PsdLoadOptions() { AllowWarpRepaint = true, LoadEffectsResource = true })) {}

You can get tempory license for free using Aspose Sites Temporary License - Purchase - aspose.com and check if the quality is applicable for your needs. Also please note, that we improve quality of warp rendering in each release.

Please provide files that you want to use in your workflow. Aspose.PSD team will create appropriate ticket for this.

@Dmitriy.Sorokin

We have already tried this approach, and sent a message here Aspose.PSD for .NET cant get warping to work in my smartobjects - #14 by yaroslav.lisovskyi
The basic warp deformation applies but mesh deformation doesn’t.

Code and PSD file: https://drive.google.com/file/d/1cM1btme0NaIRXqhmYLTjNAJuzLpaY_aa/view
Thanks!

@Alexeymkr
I can confirm issue. I’ll write you back with ETA, after the some additional investigation

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PSDNET-2483

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.