diff --git a/src/common/image.cpp b/src/common/image.cpp index 9e53e054f5..11e464a43c 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -866,6 +866,16 @@ wxImage wxImage::ConvertToGreyscale( double lr, double lg, double lb ) const } } + // copy the alpha channel, if any + if (HasAlpha()) + { + const size_t alphaSize = GetWidth() * GetHeight(); + unsigned char *alpha = (unsigned char*)malloc(alphaSize); + memcpy(alpha, GetAlpha(), alphaSize); + image.InitAlpha(); + image.SetAlpha(alpha); + } + return image; }