You are here

function imagick_image_effect_info in Imagick 7

Implements hook_image_effect_info()

File

./imagick.module, line 349
Imagick toolkit for image manipulation within Drupal.

Code

function imagick_image_effect_info() {

  // #2485715 Do nothing when image toolkit is not used
  if (variable_get('image_toolkit', 'gd') != 'imagick') {
    return array();
  }
  $effects = array();
  $effects['imagick_annotate'] = array(
    'label' => t('Annotate'),
    'help' => t('Annotates an image with text.'),
    'effect callback' => 'imagick_annotate',
    'dimensions passthrough' => TRUE,
    'form callback' => 'imagick_annotate_form',
    'default settings' => 'imagick_annotate_defaults',
  );
  $effects['imagick_autorotate'] = array(
    'label' => t('Autorotate'),
    'effect callback' => 'imagick_autorotate',
    'dimensions passthrough' => TRUE,
  );
  $effects['imagick_blur'] = array(
    'label' => t('Blur'),
    'help' => t('The intensity of the blur effect. For reasonable results, the radius should be larger than sigma.'),
    'effect callback' => 'imagick_blur',
    'dimensions passthrough' => TRUE,
    'form callback' => 'imagick_blur_form',
    'default settings' => 'imagick_blur_defaults',
  );
  $effects['imagick_charcoal'] = array(
    'label' => t('Charcoal'),
    'help' => t('Simulates a charcoal drawing.'),
    'effect callback' => 'imagick_charcoal',
    'dimensions passthrough' => TRUE,
    'form callback' => 'imagick_charcoal_form',
    'default settings' => 'imagick_charcoal_defaults',
  );
  $effects['imagick_coloroverlay_alpha'] = array(
    'label' => t('Color Overlay with Alpha'),
    'help' => t('Adds an colored overlay to an image'),
    'effect callback' => 'imagick_coloroverlay_alpha',
    'dimensions passthrough' => TRUE,
    'form callback' => 'imagick_coloroverlay_alpha_form',
    'default settings' => 'imagick_coloroverlay_defaults',
  );
  $effects['imagick_colorshift'] = array(
    'label' => t('Color Shift'),
    'help' => t('Note that colorshift is a mathematical filter that doesn\'t always have the expected result. To shift an image precisely TO a target color, desaturate (greyscale) it before colorizing. The hue (color wheel) is the <em>direction</em> the existing colors are shifted. The tone (inner box) is the amount. Keep the tone half-way up the left site of the color box for best results.'),
    'effect callback' => 'imagick_colorshift',
    'dimensions passthrough' => TRUE,
    'form callback' => 'imagick_colorshift_form',
    'default settings' => 'imagick_colorshift_defaults',
  );
  $effects['imagick_convert'] = array(
    'label' => t('Convert File Format'),
    'help' => t('If you\'ve been using transparencies in the process, the result may get saved as a PNG (as the image was treated as a one in in-between processes). If this is not desired (file sizes may get too big) you should use this process to force a flatten action before saving. For technical reasons, changing the file format does <em>not</em> change the filename suffix. A png may be saved as a *.jpg or vice versa. This may confuse some browsers and image software, but most of them have no trouble.'),
    'effect callback' => 'imagick_convert',
    'dimensions passthrough' => TRUE,
    'form callback' => 'imagick_convert_form',
    'default settings' => 'imagick_convert_defaults',
  );
  $effects['imagick_convolve'] = array(
    'label' => t('Convolve'),
    'help' => t('Applies a custom convolution kernel to the image.'),
    'effect callback' => 'imagick_convolve',
    'dimensions passthrough' => TRUE,
    'form callback' => 'imagick_convolve_form',
    'default settings' => 'imagick_convert_defaults',
    'summary theme' => 'imagick_convolve_summary',
  );
  $effects['imagick_crop'] = array(
    'label' => t('Crop'),
    'effect callback' => 'imagick_crop',
    'dimensions callback' => 'image_resize_dimensions',
    'form callback' => 'imagick_crop_form',
    'default settings' => 'imagick_crop_defaults',
    'summary theme' => 'image_crop_summary',
  );
  $effects['imagick_decipher'] = array(
    'label' => t('Decipher'),
    'help' => t('Deciphers image that has been enciphered before.'),
    'effect callback' => 'imagick_decipher',
    'dimensions passthrough' => TRUE,
    'form callback' => 'imagick_decipher_form',
    'default settings' => 'imagick_decipher_defaults',
  );
  $effects['imagick_definecanvas'] = array(
    'label' => t('Define Canvas'),
    'help' => t('Enter no color value for transparent. This will have the effect of adding clear margins around the image.'),
    'effect callback' => 'imagick_definecanvas',
    'dimensions callback' => 'imagick_definecanvas_dimensions',
    'form callback' => 'imagick_definecanvas_form',
    'default settings' => 'imagick_definecanvas_defaults',
  );
  $effects['imagick_edge'] = array(
    'label' => t('Edge'),
    'help' => t('Enhance edges within the image with a convolution filter of the given radius. Use radius 0 and it will be auto-selected.'),
    'effect callback' => 'imagick_edge',
    'dimensions passthrough' => TRUE,
    'form callback' => 'imagick_edge_form',
    'default settings' => 'imagick_edge_defaults',
  );
  $effects['imagick_emboss'] = array(
    'label' => t('Emboss'),
    'help' => t('Returns a grayscale image with a three-dimensional effect. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and it will choose a suitable radius for you.'),
    'effect callback' => 'imagick_emboss',
    'dimensions passthrough' => TRUE,
    'form callback' => 'imagick_emboss_form',
    'default settings' => 'imagick_emboss_defaults',
  );
  $effects['imagick_encipher'] = array(
    'label' => t('Encipher'),
    'help' => t('Converts plain pixels to enciphered pixels.'),
    'effect callback' => 'imagick_encipher',
    'dimensions passthrough' => TRUE,
    'form callback' => 'imagick_encipher_form',
    'default settings' => 'imagick_encipher_defaults',
  );
  $effects['imagick_frame'] = array(
    'label' => t('Frame'),
    'help' => t('Adds a simulated three-dimensional border around the image. The width and height specify the border width of the vertical and horizontal sides of the frame. The inner and outer bevels indicate the width of the inner and outer shadows of the frame.'),
    'effect callback' => 'imagick_frame',
    'dimensions callback' => 'imagick_frame_dimensions',
    'form callback' => 'imagick_frame_form',
    'default settings' => 'imagick_frame_defaults',
  );
  $effects['imagick_inverse'] = array(
    'label' => t('Inverse'),
    'effect callback' => 'imagick_inverse',
    'dimensions passthrough' => TRUE,
  );
  $effects['imagick_mirror'] = array(
    'label' => t('Mirror'),
    'help' => t('Creates a vertical or horizontal mirror image by reflecting the pixels around an axis.'),
    'effect callback' => 'imagick_mirror',
    'dimensions passthrough' => TRUE,
    'form callback' => 'imagick_mirror_form',
    'default settings' => 'imagick_mirror_defaults',
  );
  $effects['imagick_modulate'] = array(
    'label' => t('Modulate'),
    'help' => t('Lets you control the brightness, saturation, and hue of an image. Hue is the percentage of absolute rotation from the current position. For example 50 results in a counter-clockwise rotation of 90 degrees, 150 results in a clockwise rotation of 90 degrees, with 0 and 200 both resulting in a rotation of 180 degrees.'),
    'effect callback' => 'imagick_modulate',
    'dimensions passthrough' => TRUE,
    'form callback' => 'imagick_modulate_form',
    'default settings' => 'imagick_modulate_defaults',
  );
  $effects['imagick_noise'] = array(
    'label' => t('Noise'),
    'help' => t('Adds random noise to the image.'),
    'effect callback' => 'imagick_noise',
    'dimensions passthrough' => TRUE,
    'form callback' => 'imagick_noise_form',
    'default settings' => 'imagick_noise_defaults',
  );
  $effects['imagick_oilpaint'] = array(
    'label' => t('Oil paint'),
    'help' => t('Applies a special effect filter that simulates an oil painting. Each pixel is replaced by the most frequent color occurring in a circular region defined by radius.'),
    'effect callback' => 'imagick_oilpaint',
    'dimensions passthrough' => TRUE,
    'form callback' => 'imagick_oilpaint_form',
    'default settings' => 'imagick_oilpaint_defaults',
  );
  $effects['imagick_polaroid'] = array(
    'label' => t('Polaroid'),
    'help' => t('Simulates a Polaroid picture.'),
    'effect callback' => 'imagick_polaroid',
    'form callback' => 'imagick_polaroid_form',
    'default settings' => 'imagick_polaroid_defaults',
  );
  $effects['imagick_posterize'] = array(
    'label' => t('Posterize'),
    'help' => t('Reduces the image to a limited number of color level.'),
    'effect callback' => 'imagick_posterize',
    'dimensions passthrough' => TRUE,
    'form callback' => 'imagick_posterize_form',
    'default settings' => 'imagick_posterize_defaults',
  );
  $effects['imagick_resize'] = array(
    'label' => t('Resize'),
    'effect callback' => 'imagick_resize',
    'dimensions callback' => 'image_resize_dimensions',
    'form callback' => 'imagick_resize_form',
    'default settings' => 'imagick_resize_defaults',
    'summary theme' => 'image_resize_summary',
  );
  $effects['imagick_rotate'] = array(
    'label' => t('Rotate'),
    'effect callback' => 'imagick_rotate',
    'dimensions callback' => 'image_rotate_dimensions',
    'form callback' => 'imagick_rotate_form',
    'default settings' => 'imagick_rotate_defaults',
    'summary theme' => 'image_rotate_summary',
  );
  $effects['imagick_roundedcorners'] = array(
    'label' => t('Rounded corners'),
    'help' => t('Rounds image corners. The first two parameters control the amount of rounding and the three last parameters can be used to fine-tune the rounding process.'),
    'effect callback' => 'imagick_roundedcorners',
    'dimensions passthrough' => TRUE,
    'form callback' => 'imagick_roundedcorners_form',
    'default settings' => 'imagick_roundedcorners_defaults',
  );
  $effects['image_scale'] = array(
    'label' => t('Scale'),
    'help' => t('Scaling will maintain the aspect-ratio of the original image. If only a single dimension is specified, the other dimension will be calculated.
'),
    'effect callback' => 'image_scale_effect',
    'dimensions callback' => 'image_scale_dimensions',
    'form callback' => 'imagick_scale_form',
    'default settings' => 'imagick_scale_defaults',
    'summary theme' => 'image_scale_summary',
  );
  $effects['image_scale_and_crop'] = array(
    'label' => t('Scale and crop'),
    'help' => t('Scale and crop will maintain the aspect-ratio of the original image, then crop the larger dimension. This is most useful for creating perfectly square thumbnails without stretching the image.
'),
    'effect callback' => 'image_scale_and_crop_effect',
    'dimensions callback' => 'image_resize_dimensions',
    'form callback' => 'imagick_resize_form',
    'default settings' => 'imagick_resize_defaults',
    'summary theme' => 'image_resize_summary',
  );
  $effects['imagick_shadow'] = array(
    'label' => t('Shadow'),
    'help' => t('Simulates an image shadow.'),
    'effect callback' => 'imagick_shadow',
    'dimensions callback' => 'imagick_shadow_dimensions',
    'form callback' => 'imagick_shadow_form',
    'default settings' => 'imagick_shadow_defaults',
  );
  $effects['imagick_sketch'] = array(
    'label' => t('Sketch'),
    'help' => t('Simulates a pencil sketch. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and sketchImage selects a suitable radius for you. Angle gives the angle of the blurring motion.'),
    'effect callback' => 'imagick_sketch',
    'dimensions passthrough' => TRUE,
    'form callback' => 'imagick_sketch_form',
    'default settings' => 'imagick_sketch_defaults',
  );
  $effects['imagick_sharpen'] = array(
    'label' => t('Sharpen'),
    'help' => t('Applies an unsharp mask to the image.'),
    'effect callback' => 'imagick_sharpen',
    'dimensions passthrough' => TRUE,
    'form callback' => 'imagick_sharpen_form',
    'default settings' => 'imagick_sharpen_defaults',
  );
  $effects['imagick_solarize'] = array(
    'label' => t('Solarize'),
    'help' => t('Applies a special effect to the image, similar to the effect achieved in a photo darkroom by selectively exposing areas of photo sensitive paper to light. Threshold ranges from 0 to QuantumRange and is a measure of the extent of the solarization.'),
    'effect callback' => 'imagick_solarize',
    'dimensions passthrough' => TRUE,
    'form callback' => 'imagick_solarize_form',
    'default settings' => 'imagick_solarize_defaults',
  );
  $effects['imagick_spread'] = array(
    'label' => t('Spread'),
    'help' => t('Special effects method that randomly displaces each pixel in a block defined by the radius parameter.'),
    'effect callback' => 'imagick_spread',
    'dimensions passthrough' => TRUE,
    'form callback' => 'imagick_spread_form',
    'default settings' => 'imagick_spread_defaults',
  );
  $effects['imagick_swirl'] = array(
    'label' => t('Swirl'),
    'help' => t('Swirls the pixels about the center of the image, where degrees indicates the sweep of the arc through which each pixel is moved. You get a more dramatic effect as the degrees move from 1 to 360.'),
    'effect callback' => 'imagick_swirl',
    'dimensions passthrough' => TRUE,
    'form callback' => 'imagick_swirl_form',
    'default settings' => 'imagick_swirl_defaults',
  );
  $effects['imagick_trim'] = array(
    'label' => t('Trim'),
    'help' => t('Remove edges that are the background color from the image.'),
    'effect callback' => 'imagick_trim',
    'form callback' => 'imagick_trim_form',
    'default settings' => 'imagick_trim_defaults',
  );
  $effects['imagick_vignette'] = array(
    'label' => t('Vignette'),
    'help' => t('Softens the edges of the image in vignette style.'),
    'effect callback' => 'imagick_vignette',
    'dimensions passthrough' => TRUE,
    'form callback' => 'imagick_vignette_form',
    'default settings' => 'imagick_vignette_defaults',
  );
  $effects['imagick_wave'] = array(
    'label' => t('Wave'),
    'help' => t('Applies a wave filter to the image.'),
    'effect callback' => 'imagick_wave',
    'dimensions callback' => 'imagick_wave_dimensions',
    'form callback' => 'imagick_wave_form',
    'default settings' => 'imagick_wave_defaults',
  );

  // Backward compatibility for imagecache actions
  if (module_exists('imagecache_autorotate')) {
    $effects['imagecache_autorotate'] = array_remove($effects, 'imagick_autorotate');
  }
  if (module_exists('imagecache_canvasactions')) {
    $effects['canvasactions_definecanvas'] = array_remove($effects, 'imagick_definecanvas');
    $effects['canvasactions_roundedcorners'] = array_remove($effects, 'imagick_roundedcorners');
  }
  if (module_exists('imagecache_coloractions')) {
    $effects['coloractions_inverse'] = array_remove($effects, 'imagick_inverse');
    $effects['coloractions_colorshift'] = array_remove($effects, 'imagick_colorshift');
    $effects['imagecache_coloroverlay'] = array_remove($effects, 'imagick_coloroverlay_alpha');
    $effects['coloractions_convert'] = array_remove($effects, 'imagick_convert');
    $effects['coloractions_posterize'] = array_remove($effects, 'imagick_posterize');
  }
  return $effects;
}