Skip to content

[5.x]: Letterbox colour on transformed greyscale images is transparent #16857

@realjoshharrison

Description

@realjoshharrison

What happened?

Description

When applying a letterbox transform to a greyscale source image, the letterbox is coming out transparent, when it should be white.

Steps to reproduce

  1. Create a new image transform with:
  • Mode: letterbox
  • Fill colour: #ffffff
  • Image format: webp
  1. Using this transform, output a greyscale source image and a colour source image. Couple of example images I'm using attached.

Image
Image

Expected behavior

Both transformed images have a white letterbox.

Actual behavior

The greyscale source image has a transparent letterbox.
The colour source image has a white letterbox.

Thanks for taking a look!

Craft CMS version

5.6.11

PHP version

8.2.22

Operating system and version

Linux 6.12.5-linuxkit (DDEV)

Database type and version

MySQL 8.0.36

Image driver and version

Imagick 3.7.0 (ImageMagick 6.9.11-60)

Installed plugins and versions

  • CKEditor 4.6.0
  • CP Field Inspect 2.0.4

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions