Craft creating dirty transparent background on image transformations / resizing for anyone experiencing dirty transparent backgrounds when you transform transparent PNG images with Craft like this:

Source Image:



Resized, dirty:

Craft Command: craft.assets.id(2).first().getUrl({width: 300})




If you don't see the dirt, watch screen from the side!
The reason is the GD image library. If you switch to imagick, the transparent background will be clean:

Resized, clean: