你好。我这边有一个psd文件,文本内容里面有文字内投影、渐变效果的属性,但是导出jpg时,发现和原本的显示效果差异很大。这个是为什么?
也就是说:psd里面的文本有渐变、投影等效果,但是导出的Jpg 没有了。
下面是我导出的代码
var im= (PsdImage)Image.Load(@“d:\temp\example.psd”,new PsdLoadOptions() { LoadEffectsResource = true });
im.Save(Path.Combine(@“d:\temp”, $“2-1.jpg”), new JpegOptions { Quality = 100, CompressionType = JpegCompressionMode.Baseline });
我的系统是:windows 10
aspose.psd版本:25.3.0
example.zip (3.8 MB)
@yuluojie
你好!关于你在导出JPG图片时丢失文字渐变效果的问题,这可能与导出设置或效果加载有关。
在使用Aspose.PSD导出PSD文件时,确保你已经正确加载了所有的效果资源。根据你的代码,你已经使用了PsdLoadOptions
并设置了LoadEffectsResource
为true
,这通常是正确的做法。然而,有时可能还需要确保其他相关的设置也被正确配置。
以下是一个示例代码,展示了如何加载PSD文件并保存为PNG格式,以确保效果被正确应用:
var loadOptions = new PsdLoadOptions();
loadOptions.LoadEffectsResource = true; // 确保加载效果资源
loadOptions.UseDiskForLoadEffectsResource = true; // 对于大型效果使用磁盘空间
var psdImage = (PsdImage)Image.Load(@"d:\temp\example.psd", loadOptions);
var pngOptions = new PngOptions();
pngOptions.ColorType = PngColorType.TruecolorWithAlpha; // 确保透明度被保留
psdImage.Save(Path.Combine(@"d:\temp", $"output.png"), pngOptions);
请注意,虽然你使用的是JPG格式,但PNG格式更适合保留透明度和渐变效果。如果你仍然希望使用JPG格式,确保在保存时使用适当的选项。
如果问题依然存在,建议检查PSD文件中的图层效果是否在Aspose.PSD中被支持,或者查看是否有其他设置需要调整。你也可以参考Aspose的文档,了解更多关于图层效果的支持信息。
希望这些信息能帮助你解决问题!如果还有其他疑问,请随时问我。
@yuluojie
I can confirm the issue.
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-2404
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.