BFI_Image_Editor_Imagick_1_3()
Methods
- colorize — Tints the image a different color
- colorize — Tints the image a different color
- colorize — Tints the image a different color
- grayscale — Makes the image grayscale
- grayscale — Makes the image grayscale
- grayscale — Makes the image grayscale
- negate — Negates the image
- negate — Negates the image
- negate — Negates the image
- opacity — Changes the opacity of the image
Source
includes/libraries/bfi-thumb/bfi-thumb.php
class BFI_Image_Editor_Imagick_1_3 extends WP_Image_Editor_Imagick { /** Changes the opacity of the image * * @supports 3.5.1 * @access public * * @param float $opacity (0.0-1.0) * * @return boolean|WP_Error */ public function opacity( $opacity ) { $opacity /= 100; try { // From: http://stackoverflow.com/questions/3538851/php-imagick-setimageopacity-destroys-transparency-and-does-nothing // preserves transparency //$this->image->setImageOpacity($opacity); return $this->image->evaluateImage( Imagick::EVALUATE_MULTIPLY, $opacity, Imagick::CHANNEL_ALPHA ); } catch ( Exception $e ) { return new WP_Error( 'image_opacity_error', $e->getMessage() ); } } /** Tints the image a different color * * @supports 3.5.1 * @access public * * @param string hex color e.g. #ff00ff * * @return boolean|WP_Error */ public function colorize( $hexColor ) { try { return $this->image->colorizeImage( $hexColor, 1.0 ); } catch ( Exception $e ) { return new WP_Error( 'image_colorize_error', $e->getMessage() ); } } /** Makes the image grayscale * * @supports 3.5.1 * @access public * * @return boolean|WP_Error */ public function grayscale() { try { return $this->image->modulateImage( 100, 0, 100 ); } catch ( Exception $e ) { return new WP_Error( 'image_grayscale_error', $e->getMessage() ); } } /** Negates the image * * @supports 3.5.1 * @access public * * @return boolean|WP_Error */ public function negate() { try { return $this->image->negateImage( false ); } catch ( Exception $e ) { return new WP_Error( 'image_negate_error', $e->getMessage() ); } } }