Loading Support Center
Preparing the latest guides, releases, and feature request updates.
Preparing the latest guides, releases, and feature request updates.
Preparing feature requests, votes, and discussion updates.
Suggested by Pablo Sendra on Sep 8, 2026 in WordPress
When a customer uploads an SVG image with a transparent background in the product customizer and applies the "Grayscale" or "Black & White" filter, the resulting image loses its transparency: the background is filled in as solid white instead of staying transparent. This does not happen with PNG uploads, and it does not happen with the "Threshold" filters. Root cause (from reading the plugin's own code) In `src/Frontend/FileUpload/ImageUtils.php`, method `apply_imagick_filter()`: ```php $image->setImageFormat('png'); $image->setImageType(Imagick::IMGTYPE_GRAYSCALE); if ($origin_ext == 'png' && in_array($filter, array('grayscale', 'black_white'))) $image->setImageAlphaChannel(Imagick::ALPHACHANNEL_ACTIVATE); ``` `setImageType(Imagick::IMGTYPE_GRAYSCALE)` converts the image to a format that has no alpha channel. The next line is meant to restore that alpha channel afterward, but it only does so when the original upload was a PNG (`$origin_ext == 'png'`). When the original upload was an SVG (`$origin_ext == 'svg'`), that condition is false, so the alpha channel is never restored: the transparent areas of the SVG get permanently replaced with an opaque color the moment the alpha channel is removed, and there's no way to recover that transparency afterward. This affects both the `grayscale` and `black_white` filters for SVG-origin uploads. It does not affect `threshold` / `threshold_negative`, because those two filters already force transparency explicitly further down in the same function via `transparentPaintImage()`, regardless of the original file format. Suggested fix Either: - Extend the condition on that line to also cover SVG origin, e.g. `in_array($origin_ext, array('png', 'svg'))`, **and** make sure the SVG is rasterized onto a transparent canvas in the first place (set the background to transparent/`none` before `readImage()`, since a leftover default background could otherwise be baked in during rasterization rather than during the type change); or - Replace `setImageType(Imagick::IMGTYPE_GRAYSCALE)` with `transformImageColorspace(Imagick::COLORSPACE_GRAY)`, which converts color data only and never touches the alpha channel, making the explicit "reactivate alpha" step unnecessary for any origin format.
Add context that helps the team understand the workflow impact.
with your Chamevo customer account to vote or comment.