How to set the trimming color in Imagick?

后端 未结 2 1194
青春惊慌失措
青春惊慌失措 2021-01-03 03:30

I am trying to remove transparent areas of an image with php using imagick.

Image Magick provides the trim method: Imagick::trimImage

2条回答
  •  难免孤独
    2021-01-03 04:11

    Have you tried specifying your background color as a hex code, rather than instantiating an ImagickPixel for it?

    $im->setImageBackgroundColor( #D5D5D5 );
    

提交回复
热议问题