question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to write PSD with alpha channel

See original GitHub issue

I’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:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
dlemstracommented, Apr 23, 2018

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.

0reactions
dlemstracommented, Nov 27, 2018

@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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found