From 5981880a99b62b52c74619ea535abd24b6b132cf Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Mon, 25 Mar 2024 08:40:02 +1100 Subject: title changes (moved quit button away) + better compressed all the pngs --- source/core/StarImageProcessing.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/core/StarImageProcessing.cpp') diff --git a/source/core/StarImageProcessing.cpp b/source/core/StarImageProcessing.cpp index a56cedc..98f65f4 100644 --- a/source/core/StarImageProcessing.cpp +++ b/source/core/StarImageProcessing.cpp @@ -446,6 +446,10 @@ StringList imageOperationReferences(List const& operations) { } void processImageOperation(ImageOperation const& operation, Image& image, ImageReferenceCallback refCallback) { + if (image.bytesPerPixel() == 3) { + // Convert to an image format that has alpha so certain operations function properly + image = image.convert(image.pixelFormat() == PixelFormat::BGR24 ? PixelFormat::BGRA32 : PixelFormat::RGBA32); + } if (auto op = operation.ptr()) { image.forEachPixel([&op](unsigned, unsigned, Vec4B& pixel) { if (pixel[3] != 0) -- cgit v1.2.3