diff --git a/GreenshotPlugin/Core/Effects.cs b/GreenshotPlugin/Core/Effects.cs index 63f42c574..4dcbd2912 100644 --- a/GreenshotPlugin/Core/Effects.cs +++ b/GreenshotPlugin/Core/Effects.cs @@ -41,7 +41,7 @@ namespace Greenshot.Core { /// public class DropShadowEffect : IEffect { public DropShadowEffect() { - Darkness = 1f; + Darkness = 0.6f; ShadowSize = 9; ShadowOffset = new Point(-1, -1); } @@ -58,7 +58,7 @@ namespace Greenshot.Core { set; } public virtual Image Apply(Image sourceImage, out Point offsetChange) { - return ImageHelper.CreateShadow(sourceImage, Darkness, ShadowSize, ShadowOffset, out offsetChange, PixelFormat.Format32bppArgb); //Image.PixelFormat); + return ImageHelper.CreateShadow(sourceImage, Darkness, ShadowSize, ShadowOffset, out offsetChange, PixelFormat.Format32bppArgb); } } diff --git a/GreenshotPlugin/Core/ImageOutput.cs b/GreenshotPlugin/Core/ImageOutput.cs index 8bf639032..43547d583 100644 --- a/GreenshotPlugin/Core/ImageOutput.cs +++ b/GreenshotPlugin/Core/ImageOutput.cs @@ -259,23 +259,28 @@ namespace GreenshotPlugin.Core { // check for color reduction, forced or automatically, only when the DisableReduceColors is false if (!outputSettings.DisableReduceColors && (conf.OutputFileAutoReduceColors || outputSettings.ReduceColors)) { - using (WuQuantizer quantizer = new WuQuantizer((Bitmap)imageToSave)) { - int colorCount = quantizer.GetColorCount(); - LOG.InfoFormat("Image with format {0} has {1} colors", imageToSave.PixelFormat, colorCount); - if (outputSettings.ReduceColors || colorCount < 256) { - try { - LOG.Info("Reducing colors on bitmap to 256."); - tmpImage = quantizer.GetQuantizedImage(256); - if (disposeImage) { - imageToSave.Dispose(); + bool isAlpha = Image.IsAlphaPixelFormat(imageToSave.PixelFormat); + if (outputSettings.ReduceColors || (!isAlpha && conf.OutputFileAutoReduceColors)) { + using (WuQuantizer quantizer = new WuQuantizer((Bitmap)imageToSave)) { + int colorCount = quantizer.GetColorCount(); + LOG.InfoFormat("Image with format {0} has {1} colors", imageToSave.PixelFormat, colorCount); + if (outputSettings.ReduceColors || colorCount < 256) { + try { + LOG.Info("Reducing colors on bitmap to 256."); + tmpImage = quantizer.GetQuantizedImage(256); + if (disposeImage) { + imageToSave.Dispose(); + } + imageToSave = tmpImage; + // Make sure the "new" image is disposed + disposeImage = true; + } catch (Exception e) { + LOG.Warn("Error occurred while Quantizing the image, ignoring and using original. Error: ", e); } - imageToSave = tmpImage; - // Make sure the "new" image is disposed - disposeImage = true; - } catch (Exception e) { - LOG.Warn("Error occurred while Quantizing the image, ignoring and using original. Error: ", e); } } + } else if (isAlpha && !outputSettings.ReduceColors) { + LOG.Info("Skipping color reduction as the image has alpha"); } } }