Merging .dds (greyscale) Alpha / Transparency
Posted: 2018-12-06T10:16:25-07:00
I'm currently trying to merge .dds files using Magick.NET, however, I can't seem to figure out how to make it respect the Alpha channel too.
I get good results on the RGB channels using either the Merge or Mosaic functions, but both give me a completely white Alpha channel.
Here's what I have:
It's basically just one of the examples adjusted.
I've tried playing arround with defines, AlphaOptions and have been trying to solve this for a couple of hours with no luck.
Any ideas?
I get good results on the RGB channels using either the Merge or Mosaic functions, but both give me a completely white Alpha channel.
Here's what I have:
Code: Select all
using (MagickImageCollection images = new MagickImageCollection())
{
MagickImage first = new MagickImage(@"C:\Users\a\Desktop\test\1.dds");
images.Add(first);
MagickImage second = new MagickImage(@"C:\Users\a\Desktop\test\2.dds");
images.Add(second);
using (IMagickImage result = images.Merge())
{
result.Settings.SetDefine(MagickFormat.Dds, "compression", "dxt5");
result.Write(@"C:\Users\a\Desktop\test\result.dds");
}
}
I've tried playing arround with defines, AlphaOptions and have been trying to solve this for a couple of hours with no luck.
Any ideas?