Skip to content

Instantly share code, notes, and snippets.

@mkoppanen
Created October 16, 2013 16:17
Show Gist options
  • Save mkoppanen/7010578 to your computer and use it in GitHub Desktop.
Save mkoppanen/7010578 to your computer and use it in GitHub Desktop.
<?php
$im = new Imagick ('test.png');
$im->setImageBackgroundColor ('skyblue');
// This works with latest Imagick master
// $im->setImageAlphaChannel (Imagick::ALPHACHANNEL_REMOVE);
// This is the same constant value as above
$im->setImageAlphaChannel (Imagick::ALPHACHANNEL_TRANSPARENT + 2);
$im->writeImage ('test_skyblue_alpha.png');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment