@Pushbutton I make an investigation of reported issues. I can confirm them both. Were created the following bugs:
PSDNET-1071: Aspose.PSD can’t open PSD (RGB/16bit) with ZipWithoutPrediction compression
PSDNET-1072: Incorrect transparency on saving of PSD file (RGB/16bit) on export to 8bit
All these issues are related to 16 bit processing. The planned release where it will be fixed is 22.2 or 22.3.
At this moment I can suggest to you the following
Resave “Unprocessable.psd” in any PSD Editor and then try to open it with Aspose.PSD again. It helped me. It looks like different editors save it differently and Aspose.PSD doesn’t cover all cases.
Convert files from 16bit to 8bit quality if it’s not critical for you. It will lead to the quality loss.
@Pushbutton at this moment only PSDNET-1072 “Incorrect transparency on saving of PSD file (RGB/16bit) on export to 8bit” is fixed. We tried to quickly fix PSDNET-1071, but found new blocking issues. We are working on issue with the incorrect compressing. After the fix of this logic your request will be given the highest priority.
string inputPsdFile = "8bitWithTransparency.psd";
string outputPsdFile = "16bitWithTransparency.psd";
string outputImageFile = "OutputWithTransparency.png";
using (var img = Image.Load(inputPsdFile))
{
// 16 bit save options
PsdOptions p16 = new PsdOptions() { ChannelBitsCount = 16, ColorMode = ColorModes.Rgb };
img.Save(outputPsdFile, p16);
}
using (var img = Image.Load(outputPsdFile))
{
// Save picture with 16 bit colors
img.Save(outputImageFile, new PngOptions() { ColorType = Aspose.PSD.FileFormats.Png.PngColorType.TruecolorWithAlpha });
}
I checked this code sample and can confirm that in 21.8 it worked incorrect, after the saving of 8bit psd to 16 bit was missed transparency, but in Aspose.PSD 21.9 it works fine.
I have additional questions:
Did you clean Solution after the updating of Aspose.PSD to 21.9?
Do you use Aspose.PSD, but not Aspose.Imaging for this conversion?
If it still doesn’t work correct, could you please send me full project with the input files and the result you are expecting.
Sorry, I thought that just saving the file would now keep its colors, with no need to set the ‘options’ property.
I tried both of the code samples above:
outputPsdFile - the generated file still has transparency, when the original one doesn’t
outputImageFile - this file doesn’t have transparency, but I’m now losing a lot of information (since it becomes a PNG), such as layers
I’m not exactly sure what the problem is, as I have no deep knowledge of how image formats work, but is it possible for me to get a PSD fully similar to the original one?
Also, it seems that the problem are the bits per pixel - is there any way I can manipulate that, in order to get a similar result?
Finally, this problem appeared in this specific file, but the goal is to apply the algorithm to many different files - is there any way I can detect which files will have this problem just by looking at its properties?
I do not want to possibly ‘damage’ the other PSD files (which work fine), just because there’s a specific file where the ‘image.Save()’ method doesn’t work as expected.
@Pushbutton could you please provide the some simple project with the source file and the expected result. Aspose.PSD can save any file in its previous color mode / bitdepth, but you should use save options this way: var options = new PsdOptions(sourcePsdImage);
If you provide the full code sample, we can help you to resolve issues.
I’ll send you a link where you can download a simple project (.NET Core 3.1, using the latest Aspose versions).
When you run this project, in the debug/release folder, you’ll see the created files, using different methods.
Please ignore the watermark, as I didn’t add the license to the sample project.
As you can see, Method 1 and 2 add a visible change to the image (chess background from Photoshop is visible, if you zoom in) - this was also the same behavior on previous versions of Aspose.PSD (22.6.0, for example).
Note that method 1 uses the save options you’ve mentioned, however I was actually using the ‘save’ method without that parameter, which provided the same results (chess background).
This image is also in the project’s folder I’ll send via DM.
There’s another error I’m getting on 22.9 (I noticed earlier but I wasn’t sure if it was a problem on my end):
The generated files throw an error on Photoshop:
Problems were encountered readyng layers
"Background"
"BG"
because of a program error.
@Pushbutton thank you. I can confirm the bug. In the 1071 and 1072 were fixed issues with opening and conversion of 8bit to 16bit, but in the provided test project we have the opposite situation.
The publishing of the hot-fix for the Aspose.PSD 22.9 is planned for the next week, if it will be possible, the fix of your case will be added, otherwise, please follow the PSDNET-1281. Incorrect transparency on saving of 16 bit image to 16 or 8 bit image.
The issues you have found earlier (filed as PSDNET-1072) have been fixed in this update. This message was posted using Bugs notification tool by Yaroslav.Lisovskyi
The issues you have found earlier (filed as PSDNET-1071) have been fixed in this update. This message was posted using Bugs notification tool by Yaroslav.Lisovskyi
I received an update about the tickets PSDNET-1071 and PSDNET-1072.
I wanted to check in back with you, because I’m still running into some troubles with both tickets.
I’ll send you a direct message where you can test both situations, but here are the details for each of them:
PSDNET-1071:
Although the ‘Image.Load()’ now works, the ‘image.Save()’ throws the same error.
PSDNET-1072:
I’m aware that there’s a new ticket, PSDNET-1281, but I’m confused about the update I received for PSDNET-1072.
I can see in the changelog that the sample code loads a PSD, generates an intermediate PSD and then a PNG. However, the goal is not to have a PNG, but instead to have the second PSD without added transparency (from my tests, which you can see in the solution I’m sending as DM, the generated PSD still has transparency added).
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.