I’m experiencing issues with effects in psd files that are missing when saving the psd as png. Here an example psd file where “PLACEHOLDER1” and “Layer 733” have effects that go missing. Hope there is a simple fix for this. I run this code:
try:
# Load the PSD file
print(f"Loading PSD file: {psd_local_path}")
load_opts = PsdLoadOptions()
load_opts.load_effects_resource = True # <-- Effekte laden & rendern
load_opts.allow_warp_repaint = True
with _load_psd_with_effects(psd_local_path) as img:
psd_image = cast(PsdImage, img)
_log_layer_effects(psd_image)
print(f"PSD file loaded with {len(psd_image.layers)} layers")
# Check if loaded file is a PSD file
if not isinstance(psd_image, PsdImage):
raise TypeError(f"The file is of type: {type(psd_image)} and not a valid PSD file.")
print(f"PSD file loaded with {len(psd_image.layers)} layers")
# (optional) prüfen, ob Effekte an den Smart-Objekt-Ebenen aktiv sind
for layer in psd_image.layers:
try:
bo = layer.blending_options
if bo is not None and not bo.are_effects_enabled:
bo.are_effects_enabled = True
except Exception:
pass
# Flag to check if at least one SmartObject was found
smart_object_found = False
# Iterate through all layers
for layer in psd_image.layers:
# Check if the layer is a SmartObjectLayer and if its name is in our list
if is_assignable(layer, SmartObjectLayer) and layer.display_name in layer_names_to_replace:
# Cast the layer to SmartObjectLayer
smart_object_layer = cast(SmartObjectLayer, layer)
print(f"Replacing content in SmartObject layer: {layer.display_name}")
# Replace the content of the SmartObject with ResolutionSetting
res_settings = ResolutionSetting(300.0, 300.0) # Set resolution to 300 DPI
smart_object_layer.replace_contents(temp_image_path, res_settings)
smart_object_layer.update_modified_content() # Update changes
print(f"Content replaced in layer: {layer.display_name}")
smart_object_found = True
if not smart_object_found:
raise ValueError("No SmartObject with the specified names found.")
# Save the edited PSD file as PNG
print(f"Saving edited PSD as PNG to: {output_png_path}")
png_options = PngOptions()
png_options.color_type = PngColorType.TRUECOLOR_WITH_ALPHA # Important for transparency
psd_image.save(output_png_path, png_options)
if not os.path.exists(output_png_path):
raise FileNotFoundError(f"The output PNG file was not created: {output_png_path}")
output_file_size = os.path.getsize(output_png_path)
print(f"Saved output PNG: {output_png_path}, size: {output_file_size} bytes")
It sounds like you’re encountering issues with missing effects when saving PSD files as PNGs using Aspose.PSD. Here’s a structured approach to troubleshoot and resolve the issue:
Cause: The missing effects in the PNG output may stem from incorrect loading of effects, disabled blending options, or issues with Smart Object layers.
Solution:
Ensure Effects are Loaded: Confirm that load_opts.load_effects_resource = True is set correctly when loading the PSD file.
Check Layer Effects: After loading the PSD, iterate through the layers to ensure that blending options are enabled. Check if layer.blending_options is not null and set bo.are_effects_enabled = True if necessary.
Update Smart Object Layers: If you are replacing contents in Smart Object layers, ensure the replacement is done correctly. After replacing the content, call smart_object_layer.update_modified_content() to apply the changes.
Save Options: When saving the image as PNG, ensure you are using the correct options. Using PngOptions with PngColorType.TRUECOLOR_WITH_ALPHA is appropriate for maintaining transparency.
Test with Different Files: Test with various PSD files to determine if the issue is specific to the file you are using or if it is a broader problem.
Next Steps: Here’s a minimal code snippet to ensure effects are enabled and layers are processed correctly:
for layer in psd_image.layers:
if layer.blending_options:
layer.blending_options.are_effects_enabled = True
# Save the edited PSD file as PNG
png_options = PngOptions()
png_options.color_type = PngColorType.TRUECOLOR_WITH_ALPHA
psd_image.save(output_png_path, png_options)
If you continue to experience issues, check the release notes for any known bugs or updates related to effects handling in the version of Aspose.PSD you are using.
@caseai
I can confirm issue, it looks that the Gradient Overlay on the this Smart Object can not be rendered correctly.
We have opened the following new ticket(s) with High Priority in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): PSDNET-2565,PSDPYTHON-233
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.
@caseai Layer 733 gradient rendering works acceptable, but can be improved. This issue needs additional investigation. I tried not to replace contents of Smart object, tried to use the specified gradient with regular layer instead of smart object, but the result was the same. Possible there is not only the one issue, but the combination, or this can be issue with the update of PSD Format Specification. In common cases base Layer Effects work fine, but not in this file.
@caseai the release process of Aspose.PSD 25.9 for .NET is in process, so the possible release where it will be resolved is 25.10, it will made in the beginning of October, and there will be time lag about 1 week to release Python version.
The issues you have found earlier (filed as PSDNET-2565) have been fixed in this update. This message was posted using Bugs notification tool by yaroslav.lisovskyi
@caseai The issue has been fixed in Aspose.PSD 25.10 for .NET.
This month’s release of Python 25.10 is delayed due to technical issues. We’ll let you know as soon as it’s released.
Thanks I just installed the update and it doesnt work for me yet. Please find the code I’m running + psd file I’m using here: Unique Download Link | WeTransfer. The effect is still missing for me…
@caseai please note, your new example differs from that was provided with issue previosly.
At this moment, I can not confirm significant difference between Photoshop Rendering and Aspose.PSD rendering.
@caseai we made additional investigation. It seems, different versions of Photoshop render this gradient different. Please check the following gif file at least. auto7.gif (2.1 MB)
Your provided has thin gradient line, but if we change scale from 10% and then to again to the 10%, Photoshop rerender it like it implemented in Aspose.PSD.
The Adobe Photoshop 2026 CC, renders it with thin gradient line. Could you please describe your work pipeline and what version of Photoshop and under what OS do you use. At this moment we want to create task to support “smooth” gradient, but it doesn’t solve your issue if you use specific version of Photoshop.