Unable to write PSD with alpha channel
See original GitHub issueI’m using Magick.NET 7.4.3 to convert a TGA image with alpha into a PSD with the same alpha channel but the resulting image always has the alpha blended and the actual alpha channel lost. I’ve even tried using a source PSD with alpha and writing it back out as PSD and the same issue occurs. Here are few issues I’ve noticed:
- Setting AlphaUnblended has no impact on the resulting image whether it’s set true or false in the MagickReadSettings.
- Regardless of write setting saved PSD image never has alpha channel.
- Using MagickImageCollection when reading source PSD keeps the color channels intact but still looses alpha channel
- Using MagickImage when reading source PSD always blends in the alpha into color and still looses alpha channel itself. Here is a sample code:
MagickReadSettings readSettings = new MagickReadSettings()
{
Defines = new PsdReadDefines()
{
AlphaUnblend = false
}
};
using (MagickImageCollection image = new MagickImageCollection())
{
image.Read(inPsdFilePath, readSettings);
image.Write(outPsdFilePath); // results in PSD with good color channels but no alpha channel
}
using (MagickImage image = new MagickImage())
{
image.Read(inPsdFilePath, readSettings);
image.Write(outPsdFilePath); // results in PSD with blended alpha and no alpha channel
}
(source psd is a simple single layer red flood with single alpha channel)
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Cannot save alpha channel as PNG. need help.
Hi, I am running PS CS5. I am working on my business logo and love the way it has turned out with a...
Read more >Alpha channel not working in Photoshop
I've been trying to add an alpha channel to my psd file but Unity isn't recognizing it and I don't know why… I've...
Read more >How can I prevent Photoshop from adding an alpha ...
1 Answer 1 ... Flattening the image (Layer > Flatten Image) fixed it. It became a locked "background" layer and now it saves...
Read more >IM can't tell that alpha channel is turned off in PSD file
However, in the PSD files, the alpha channel was turned off, deactivated, invisible, however you want to say it.
Read more >What Are Alpha Channels In Photoshop And How To Use ...
Every image you edit in Photoshop has three channels by default. These channels consist of red, green, and blue to make up RGB....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I still don’t understand what is wrong. I stepped through the decoder with a debugger and the output image
WithAlpha_converted
has a separate alpha channel. The alpha channel is not blended in the other channels. I have no other way that to use Magick.NET/ImageMagick to inspect your output images so I don’t understand why you came to this conclusion.@FuzzyTrace It is still a bit unclear to mean what the bug is that you are trying to report. Can you reproduce your issue with the latest release and can you try to explain again what is incorrect?