I have my image transforms set to crop centre-centre with quality 100, but for some reason the images that are rendered have a high change of having 1 or 2 pixels of white added to at least one set of parallel sides.

See below for an example of what is being output (black background added after the fact for emphasis):

Example of issue

The original image was a JPG with no white border. As far as I can tell, the issue is most prevalent when trying to crop in only one direction. For example, the the image above should only be being cropped on the top and bottom, as the width of the original is the same as the width of the outputted image.

Has anyone else come across this issue? If so, is there a fix?

Running locally on MAMP with PHP 5.6.10, using GD. Craft Pro 2.4.2679

  • MAMP has Imagick bundled, but you need to edit your php.ini file to un-comment it. Try that and see if the issue goes away.
    – Brad Bell
    Commented Jul 27, 2015 at 17:24

2 Answers 2


As @BradBell says, using Imagick fixed this for me.
Following https://stackoverflow.com/a/16154605/662826 I uncommented the Imagick extension, reuploaded and the compression was much better and white line gone.

  • ImageMagick does seem to fix the issue, as long as you re-upload the affected images.
    – Tam
    Commented Jul 29, 2015 at 14:30

I think this might have happened due to a Craft update. You can see the difference between these two blog posts

July 16 - http://roseandmary.com/blog/2015/friends-family-tasting-event
July 07- http://roseandmary.com/blog/2015/the-rose-mary-team

The last post image doesn't have the border and every image uploaded since gets a single px white border.

  • With communication with Pixel & Tonic and this is caused by some older versions of the GD image library. Using ImageMagik will help and there should be a fix for the GD issue in an upcoming update of Craft CMS.
    – Gnative
    Commented Aug 12, 2015 at 8:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.