class Pixie::Image

Included Modules

Defined in:

pixie/image.cr

Constructors

Class Method Summary

Instance Method Summary

Class methods inherited from module Pixie::Helpers

assert_no_exception(exception_info : LibMagick::ExceptionInfo) assert_no_exception

Constructor Detail

def self.new(width : Int, height : Int, background_color : Pixel = Pixel::TRANSPARENT) #

Creates a new blank image using the given width, height, and background color. The default background color is transparent, and the format is set to PNG.

Example:

image = Image.new(640, 480, Pixel::RED)

[View source]
def self.new(wand : Pointer(LibMagick::MagickWand)) #

Creates a new Image from the given LibMagick::MagickWand instance.


[View source]
def self.new(image : Pointer(LibMagick::Image)) #

Creates a new Image from the given LibMagick::Image instance.


[View source]
def self.new(input : String | Bytes | IO) #

Creates a new Image from the given stream. See Image#read for more information.


[View source]
def self.new(images : Array(String) | Array(Bytes) | Array(IO)) #

Creates a new Image from the given Array, where each element is a layer in the image.


[View source]
def self.new(image : Image) #

Creates a new Image from the given Pixie::Image instance.


[View source]
def self.new #

Creates a new Image with no data. This is the underlying method used by all other constructors.


[View source]

Class Method Detail

def self.import_pixels(pixels : Iterable(Int), width : Int, height : Int, depth : Int, map : String) #

Create an image from a map of pixels.

Example:

image = Image.import_pixels(pixels, 0, 0, 16, "RGB")

[View source]

Instance Method Detail

def ==(other : Image) #

[View source]
def [](index : Int) #

Get the individual image (layer) at the given index.

Example:

image = Image.new("/path/to/image.gif")
image[0] # => Image

[View source]
def [](format : String) #

Get image details using special formatting characters. See https://imagemagick.org/script/escape.php

Example:

image = Image.new("/path/to/image.png")
image["%w"] # => "640"
image["%h"] # => "480"
image["%f"] # => "image.png"

[View source]
def adaptive_blur(radius : Float, sigma : Float) #

Apply an adaptive blur to the image.


[View source]
def adaptive_resize(width : Int, height : Int, preserve_aspect_ratio : Bool = false) #

Apply an adaptive resize to the image.


[View source]
def adaptive_sharpen(radius : Float, sigma : Float) #

Apply an adaptive sharpen to the image.


[View source]
def adaptive_threshold(width : Int, height : Int, bias : Float) #

Apply an adaptive threshold to the image.


[View source]
def add_image(image : Image) #

Add an image to the image set.


[View source]
def add_noise(noise_type : LibMagick::NoiseType, attenuate : Float = 1.0) #

Add noise to the image. Valid noise types are:

  • :undefined
  • :uniform
  • :gaussian
  • :multiplicative_gaussian
  • :impulse
  • :laplacian
  • :poisson
  • :random

[View source]
def affine_transform(brush : Brush) #

[View source]
def animate(server_name : String = ":0") #

Animate the image sequence using the given server name.


[View source]
def annotate(brush : Brush, x : Float, y : Float, angle : Float, text : String) #

[View source]
def append(top_to_bottom : Bool = false) #

Append all images together into a single image.


[View source]
def auto_gamma #

Automatically adjust the gamma level of this image.


[View source]
def auto_level #

Automatically adjust the level of this image.


[View source]
def auto_orient #

Automatically orient the image based on its EXIF data.


[View source]
def auto_threshold(method : LibMagick::AutoThresholdMethod) #

Automatically threshold the image using the given method. Valid methods are:

  • :undefined
  • :kapur
  • :ohtsu
  • :triangle

[View source]
def background_color #

Return the background color of the image as a Pixie::Pixel.


[View source]
def black_threshold(threshold : Pixel) #

Set the black threshold of the image.


[View source]
def blob #

Get the image as a Bytes instance.


[View source]
def blue_primary #

Returns the chromaticity blue primary point for the image as an x, y, z tuple.


[View source]
def blue_shift(factor : Float) #

Set the blue shift factor of the image.


[View source]
def blur(radius : Float, sigma : Float) #

Blur the image using the given radius and sigma.


[View source]
def border(border_color : Pixel, width : Int, height : Int, compose : LibMagick::CompositeOperator = :undefined) #

Add a border to the image using the given Pixie::Pixel.


[View source]
def border_color #

Return the border color of the image as a Pixie::Pixel.


[View source]
def brightness_contrast(brightness : Float, contrast : Float) #

Apply a brightness and contrast adjustment to the image.


[View source]
def bytesize #

[View source]
def canny_edge(radius : Float, sigma : Float, lower_percent : Float, upper_percent : Float) #

Detect edges in the image using the given radius.


[View source]
def channel_fx(expression : String) #

Applies a channel expression to the specified image.


[View source]
def charcoal(radius : Float, sigma : Float) #

Apply a charcoal effect to the image using the given radius and sigma.


[View source]
def chop(width : Int, height : Int, x : Int, y : Int) #

Removes a region of a canvas and collapses the canvas to occupy the removed portion.


[View source]
def clahe(width : Int, height : Int, number_bins : Float, clip_limit : Float) #

a variant of adaptive histogram equalization in which the contrast amplification is limited, so as to reduce this problem standard non-contrast limited AHE.


[View source]
def clamp #

Restricts the color range from 0 to the quantum depth.


[View source]
def clear #

[View source]
def clip #

Clips along the first path from the 8BIM profile, if present.


[View source]
def clip_path(pathname : String, inside : Bool = false) #

Clips along the named paths from the 8BIM profile, if present. Later operations take effect inside the path. Id may be a number if preceded with #, to work on a numbered path, e.g., "#1" to use the first path.


[View source]
def clone #

[View source]
def clut(clut : Image, method : LibMagick::PixelInterpolateMethod) #

Replaces colors in the image from a color lookup table.


[View source]
def coalesce #

Composites a set of images while respecting any page offsets and disposal methods. GIF, MIFF, and MNG animation sequences typically start with an image background and each subsequent image varies in size and offset. Returns a new sequence where each image in the sequence is the same size as the first and composited with the next image in the sequence.


[View source]
def collect_unique_colors #

[View source]
def color_correct(collection : String) #

accepts a lightweight Color Correction Collection (CCC) file which solely contains one or more color corrections and applies the color correction to the image. Here is a sample CCC file:

  <ColorCorrectionCollection xmlns="urn:ASC:CDL:v1.2">
    <ColorCorrection id="cc03345">
      <SOPNode>
        <Slope> 0.9 1.2 0.5 </Slope>
        <Offset> 0.4 -0.5 0.6 </Offset>
        <Power> 1.0 0.8 1.5 </Power>
      </SOPNode>
      <SATNode>
        <Saturation> 0.85 </Saturation>
      </SATNode>
    </ColorCorrection>
  </ColorCorrectionCollection>

which includes the offset, slope, and power for each of the RGB channels as well as the saturation.


[View source]
def color_matrix(matrix : LibMagick::KernelInfo) #

Apply color transformation to an image. The method permits saturation changes, hue rotation, luminance to alpha, and various other effects. Although variable-sized transformation matrices can be used, typically one uses a 5x5 matrix for an RGBA image and a 6x6 for CMYKA (or RGBA with offsets). The matrix is similar to those used by Adobe Flash except offsets are in column 6 rather than 5 (in support of CMYKA images) and offsets are normalized (divide Flash offset by 255).


[View source]
def colorize(colorize : Pixel, blend : Pixel) #

Blends the fill color with each pixel in the image.


[View source]
def colormap_color(index) #

[View source]
def colors #

[View source]
def colorspace #

[View source]
def combine(colorspace : LibMagick::ColorspaceType) #

Combines one or more images into a single image. The grayscale value of the pixels of each image in the sequence is assigned in order to the specified channels of the combined image. The typical ordering would be image 1 => Red, 2 => Green, 3 => Blue, etc.


[View source]
def comment(comment : String) #

Adds a comment to your image.


[View source]
def compare(reference : Image, metric : LibMagick::MetricType, distortion : Float) #

Compares an image to a reconstructed image and returns the specified difference image.


[View source]
def compare_layers(method : LibMagick::LayerMethod) #

Compares each image with the next in a sequence and returns the maximum bounding region of any pixel differences it discovers.


[View source]
def complex(op : LibMagick::ComplexOperator) #

Performs complex mathematics on an image sequence using the given oprtator. Valid operators are:

  • :undefined
  • :add
  • :conjugate
  • :divide
  • :magnitude_phase
  • :multiply
  • :real_imaginary
  • :subtract

[View source]
def composite(source : Image, operator : LibMagick::CompositeOperator, clip_to_self : Bool, x : Int, y : Int) #

Composites two images together using the given operator. See Image#complex for a list of valid operators.


[View source]
def composite(source : Image, compose : LibMagick::CompositeOperator, gravity : LibMagick::GravityType) #

Composites two images together using the given operator and gravity. See Image#complex for a list of valid operators. Valid gravities are:

  • :undefined
  • :forget
  • :north_west
  • :north
  • :north_east
  • :west
  • :center
  • :east
  • :south_west
  • :south
  • :south_east
  • :static

[View source]
def composite_layers(source : Image, compose : LibMagick::CompositeOperator, x : Int, y : Int) #

Composite the images in the source wand over the images in the destination wand in sequence, starting with the current image in both lists. Each layer from the two image lists are composted together until the end of one of the image lists is reached. The offset of each composition is also adjusted to match the virtual canvas offsets of each layer. As such the given offset is relative to the virtual canvas, and not the actual image. Composition uses given x and y offsets, as the 'origin' location of the source images virtual canvas (not the real image) allowing you to compose a list of 'layer images' into the destination images. This makes it well suitable for directly composing 'Clears Frame Animations' or 'Coalesced Animations' onto a static or other 'Coalesced Animation' destination image list. GIF disposal handling is not looked at.

Special case:- If one of the image sequences is the last image (just a single image remaining), that image is repeatedly composed with all the images in the other image list. Either the source or destination lists may be the single image, for this situation. In the case of a single destination image (or last image given), that image will be cloned to match the number of images remaining in the source image list. This is equivalent to the "-layer Composite" Shell API operator.

For a list of valid operators, see Image#complex.


[View source]
def composite_operator #

[View source]
def compression #

[View source]
def compression_quality #

[View source]
def connected_components(connectivity : Int) #

Returns the connected-components of the image uniquely labeled. The returned connected components image colors member defines the number of unique objects. Choose from 4 or 8-way connectivity.


[View source]
def constitute(columns : Int, rows : Int, map : String, storage : LibMagick::StorageType, pixels : Array(U)) forall U #

Adds an image to the wand comprised of the pixel data you supply. The pixel data must be in scanline order top-to-bottom. The data can be char, short int, int, float, or double. Float and double require the pixels to be normalized [0..1], otherwise [0..Max], where Max is the maximum value the type can accomodate (e.g. 255 for char).

For example, to create a 640x480 image from unsigned red-green-blue character data:

image = Image.new
data = Array(UInt8).new(640 * 480 * 3) { 0u8 }
image.constitute(640, 480, "RGB", :char, data)

[View source]
def contrast(sharpen : Bool) #

Enhances the intensity differences between the lighter and darker elements of the image. Set sharpen to a value other than 0 to increase the image contrast otherwise the contrast is reduced.


[View source]
def contrast_stretch(black_point : Float, white_point : Float) #

Enhances the contrast of a color image by adjusting the pixels color to span the entire range of colors available. You can also reduce the influence of a particular channel with a gamma value of 0.


[View source]
def convolve(kernel : LibMagick::KernelInfo) #

Applies a custom convolution kernel to the image.


[View source]
def crop(width : Int, height : Int, x : Int, y : Int) #

Extracts a region of the image.


[View source]
def cycle_colormap(displace : Int) #

Displaces an image's colormap by a given number of positions. If you cycle the colormap a number of times you can produce a psychodelic effect.


[View source]
def decipher(passphrase : String) #

Converts cipher pixels to plain pixels.


[View source]
def deconstruct #

Compares each image with the next in a sequence and returns the maximum bounding region of any pixel differences it discovers.


[View source]
def delay #

[View source]
def delete_property(name : String) #

Delete a specific property of the image.

Example:

image = Image.new("/path/to/image.png")
image.delete_property("exif:GPSLatitude")

[View source]
def depth #

[View source]
def deskew(threshold : Float) #

Removes skew from the image. Skew is an artifact that occurs in scanned images because of the camera being misaligned, imperfections in the scanning or surface, or simply because the paper was not placed completely flat when scanned.


[View source]
def despeckle #

Reduces the speckle noise in an image while perserving the edges of the original image.


[View source]
def display(x_server : String = ":0") #

Displays an image using the given X server.


[View source]
def displays(x_server : String = ":0") #

Displays an image sequence using the given X server.


[View source]
def dispose #

[View source]
def distort(method : LibMagick::DistortMethod, args : Array(Float64), best_fit : Bool = false) #

Distorts an image using various distortion methods, by mapping color lookups of the source image to a new destination image usally of the same size as the source image, unless best_fit is set to true.

Valid distortion methods are:

  • :undefined
  • :affine
  • :affine_projection
  • :scale_rotate_translate
  • :perspective
  • :perspective_projection
  • :bilinear_forward
  • :bilinear_reverse
  • :polynomial
  • :arc
  • :polar
  • :de_polar
  • :cylinder2plane
  • :plane2cylinder
  • :barrel
  • :barrel_inverse
  • :shepards
  • :resize
  • :sentinel

Example:

image = Image.new("/path/to/image.png")
image.distort(:affine, [0.0, 0.0, 0.0, 0.0, 0.0, 0.0])

[View source]
def distortion(reference : Wand, metric : LibMagick::MetricType) #

[View source]
def distortions(reference : Wand, metric : LibMagick::MetricType, channel : LibMagick::ChannelType) #

[View source]
def draw(brush : Brush) #

[View source]
def draw(&block : Brush -> ) #

[View source]
def edge(radius : Float = 0.0) #

Enhances edges within the image with a convolution filter of the given radius. Using a radius of 0 will select a suitable radius for you.


[View source]
def emboss(radius : Float = 0.0, sigma : Float = 0.0) #

Enhance edges within the image with a convolution filter of the given radius and sigma. Using a radius of 0 will select a suitable radius for you.


[View source]
def encipher(passphrase : String) #

[View source]
def endian #

[View source]
def enhance #

[View source]
def enhance_local_contrast(radius : Float64, strength : Float64) #

[View source]
def equalize #

[View source]
def evaluate(operator : LibMagick::MagickEvaluateOperator, value : Float) #

[View source]
def evaluate(operator : LibMagick::MagickEvaluateOperator) #

[View source]
def exif #

Return EXIF data for the image as a Hash(String, String).


[View source]
def extent(width : Int, height : Int, x : Int, y : Int) #

Extend the image as defined by the geometry, gravity, and wand background color. Set the (x,y) offset of the geometry to move the original wand relative to the extended wand.


[View source]
def features(distance) #

[View source]
def filename #

[View source]
def finalize #

[View source]
def flip #

[View source]
def flood_fill_paint(fill : Pixel, fuzz : Float, border_color : Pixel, x : Int, y : Int, invert : Bool = false) #

[View source]
def flop #

[View source]
def format #

[View source]
def forward_fourier_transform(magnitude : Float) #

[View source]
def frame(matte_color : Pixel, width : Int, height : Int, inner_bevel : Int, outer_bevel : Int, compose : LibMagick::CompositeOperator) #

[View source]
def function(function : LibMagick::MagickFunction, args : Array(Float64)) #

[View source]
def fuzz #

[View source]
def fx(expression : String) #

[View source]
def gamma(gamma : Float) #

[View source]
def gamma #

[View source]
def gaussian_blur(radius : Float, sigma : Float) #

[View source]
def get_region(width, height, x, y) #

[View source]
def gravity #

[View source]
def green_primary #

Returns the chromaticity green primary point for the image as an x, y, z tuple.


[View source]
def has_alpha? #

Returns true if the image has an alpha channel.


[View source]
def has_next? #

Returns true if there are multiple images in the image set, and #pos is less than the number of images.


[View source]
def has_prev? #

Returns true if there are multiple images in the image set, and #pos is greater than zero.


[View source]
def hash #
Description copied from class Object

Generates an UInt64 hash value for this object.

This method must have the property that a == b implies a.hash == b.hash.

The hash value is used along with #== by the Hash class to determine if two objects reference the same hash key.

Subclasses must not override this method. Instead, they must define hash(hasher), though usually the macro def_hash can be used to generate this method.


[View source]
def height #

Return the height of the image.


[View source]
def histogram(n_colors = nil) #

[View source]
def hough_line(width, height, threshold) #

[View source]
def identify #

[View source]
def identify_type #

[View source]
def image_similarity(reference : Wand, metric : LibMagick::MetricType, threshold : Float64) #

[View source]
def implode(radius, method : PixelInterpolateMethod = :average) #

[View source]
def import_pixels(pixels : Iterable(Int), width, height, depth : Int, map : String = "RGB") #

[View source]
def intent #

[View source]
def interlace_scheme #

[View source]
def interpolative_resize(width, height, method : LibMagick::PixelInterpolateMethod = :average, preserve_aspect_ratio : Bool = false) #

[View source]
def inverse_fourier_transform(phase_image : Pixie::Wand, magnitude = false) #

[View source]
def iterations #

[View source]
def kurtosis #

TODO Figure out how to specify a channel


[View source]
def kuwahara_filter(radius : Float64, sigma : Float64) #

[View source]
def label(label : String) #

[View source]
def layers #

Returns an Array(Image), where each image is a layer in the image. Useful for gif, pdf, psd, and any other image format with layers.

Example:

image = Image.new("/path/to/image.gif")
image.layers # => Array(Image)

[View source]
def level(black_point : Float64, gamma : Float64, white_point : Float64) #

[View source]
def level_colors(black_color : Pixel, white_color : Pixel, invert = false) #

[View source]
def levelize(black_point : Float64, white_point : Float64, gamma : Float64) #

[View source]
def linear_stretch(black_point : Float64, white_point : Float64) #

[View source]
def liquid_rescale(width : Int, height : Int, delta_x : Float64 = 0.0, rigidity : Float64 = 0.0) #

[View source]
def lower(width : Int, height : Int, x : Int, y : Int) #

[View source]
def magnify #

[View source]
def matte_color #

[View source]
def mean #

[View source]
def mean_shift(width : Int, height : Int, color_distance : Float64) #

[View source]
def merge_layers(method : LibMagick::LayerMethod = :merge) #

[View source]
def minify #

[View source]
def modulate(brightness : Float64, saturation : Float64, hue : Float64) #

[View source]
def montage(thumbnail_geometry : String | Nil = nil, tile_geometry : String | Nil = nil, brush : Brush = Brush.new, mode : LibMagick::MontageMode = :undefined, frame : String | Nil = nil) #

Create a montage from the images in the current set.


[View source]
def morphology(n_frames : Int) #

[View source]
def morphology_method(method : LibMagick::MorphologyMethod, iterations : Int, kernel : Pointer(LibMagick::KernelInfo)) #

[View source]
def motion_blur(radius : Float64, sigma : Float64, angle : Float64) #

[View source]
def negate(gray : Bool) #

[View source]
def next #

Returns the next image in the image set.


[View source]
def normalize #

[View source]
def oil_paint(radius : Float64, sigma : Float64) #

[View source]
def opaque_paint(target_color : Pixel, fill_color : Pixel, fuzz : Float64, invert : Bool = false) #

[View source]
def optimize_layers #

[View source]
def optimize_transparency #

[View source]
def ordered_dither(threshold_map : String) #

[View source]
def orientation #

[View source]
def page #

[View source]
def path : String | Nil #

The location of the current working file


[View source]
def pixel(x, y) #

Get the pixel at the given x and y coordinates.


[View source]
def pixel_interpolation_method #

[View source]
def pixels(x : Int = 0, y : Int = 0, columns : Int = width, rows : Int = height, map : String = "RGB", storage : LibMagick::StorageType = :char) #

Extract pixel data from the image and return it as a multi-dimensional array of rows and columns, each containing an array of pixel data represnting the given map (defaulting to RGB). The map can be any combination or order of:

  • R = red
  • G = green
  • B = blue
  • A = alpha (0 is transparent)
  • O = opacity (0 is opaque)
  • C = cyan
  • Y = yellow
  • M = magenta
  • K = black
  • I = intensity (for grayscale)
  • P = pad

Example:

image = Image.new("/path/to/image.png")
image.pixels.each do |row|
  row.each do |col|
    puts col # => [255, 255, 255]
  end
end

[View source]
def polaroid(brush : Brush, caption : String, angle : Float64, method : LibMagick::PixelInterpolateMethod = :average) #

[View source]
def polynomial(n_terms : Int, terms : Float64) #

[View source]
def pos #

Returns the current position in the image set. Will always be zero for non-animated images.


[View source]
def posterize(levels : Int, dither_method : LibMagick::DitherMethod = :none) #

[View source]
def prev #

Returns the previous image in the image set.


[View source]
def preview_transform(type : LibMagick::PreviewType) #

[View source]
def property(name : String) #

Get a specific property of the image.

Example:

image = Image.new("/path/to/image.png")
image.property("date:create") # => "2019:01:01 12:00:00"

[View source]
def quantize(n_colors : Int, colorspace : LibMagick::ColorspaceType, treedepth : Int, dither_method : LibMagick::DitherMethod = :none, measure_error : Bool = false) #

[View source]
def quantize_all(n_colors : Int, colorspace : LibMagick::ColorspaceType, treedepth : Int, dither_method : LibMagick::DitherMethod = :none, measure_error : Bool = false) #

[View source]
def query_fonts(pattern : String) #

[View source]
def query_formats(pattern : String) #

[View source]
def raise(width : Int, height : Int, x : Int, y : Int) #

[View source]
def random_threshold(low : Float64, high : Float64) #

[View source]
def range #

[View source]
def range_threshold(low_black : Float64, low_white : Float64, hight_white : Float64, hight_black : Float64) #

[View source]
def read(filename : String) #

[View source]
def read(buffer : IO) #

[View source]
def read(buffer : Bytes) #

[View source]
def red_primary #

Returns the chromaticity red primary point for the image as an x, y, z tuple.


[View source]
def remap(affinity : Wand, method : LibMagick::DitherMethod = :none) #

[View source]
def remove #

[View source]
def resample(x_resolution : Float64, y_resolution : Float64, filter : LibMagick::FilterType) #

[View source]
def reset_page(page : String) #

[View source]
def resize(width : Int, height : Int, filter : LibMagick::FilterType = :lanczos) #

Resize the image to fit within the specified dimensions. Stretching may occur.


[View source]
def resize_to_fit(width : Int, height : Int, filter : LibMagick::FilterType = :lanczos) #

Resize the image to not be larger than the specified dimensions. No stretching will occur.


[View source]
def resolution #

[View source]
def rewind #

Reset the underlying iterator to the first image in the set.


[View source]
def roll(x : Int, y : Int) #

[View source]
def rotate(background : Pixel, degrees : Float64) #

[View source]
def rotational_blur(angle : Float64) #

[View source]
def sample(width : Int, height : Int) #

[View source]
def scale(width : Int, height : Int) #

[View source]
def scene #

[View source]
def segment(colorspace : LibMagick::ColorspaceType, cluster_threshold : Float64, smooth_threshold : Float64, verbose = false) #

[View source]
def selective_blur(radius : Float64, sigma : Float64, threshold : Float64) #

[View source]
def separate(channel : LibMagick::ChannelType) #

[View source]
def sepia(threshold : Float64) #

[View source]
def set(image : Wand) #

[View source]
def set_alpha(value : LibMagick::AlphaChannelOption) #

Set the image's alpha channel to the given LibMagick::AlphaChannelOption. Valid options are:

  • :undefined
  • :activate
  • :associate
  • :background
  • :copy
  • :deactivate
  • :discrete
  • :disassociate
  • :extract
  • :off
  • :on
  • :opaque
  • :remove
  • :set
  • :shape
  • :transparent

[View source]
def set_artifact(key : String, value : String) #

[View source]
def set_background_color(background : Pixel) #

Set the background color of the image to the given Pixie::Pixel.


[View source]
def set_blue_primary(x, y, z) #

Set the chromaticity blue primary point for the image to the given x, y, and z values.


[View source]
def set_border_color(color : Pixel) #

Set the border color of the image to the given Pixie::Pixel.

Example:

image = Image.new("/path/to/image.png")
image.border_color = Pixel::RED

[View source]
def set_color(color : Pixel) #

[View source]
def set_colormap_color(index : Int, color : Pixel) #

[View source]
def set_colorspace(colorspace : LibMagick::ColorspaceType) #

[View source]
def set_composite_operator(op : LibMagick::CompositeOperator) #

[View source]
def set_compression(value : LibMagick::CompressionType) #

[View source]
def set_compression_quality(quality : Int) #

[View source]
def set_delay(val : Int) #

[View source]
def set_depth(val : Int) #

[View source]
def set_dispose(val : LibMagick::DisposeType) #

[View source]
def set_endian(val : LibMagick::EndianType) #

[View source]
def set_extent(width : Int, height : Int) #

[View source]
def set_filename(val : String) #

[View source]
def set_format(val : String) #

[View source]
def set_fuzz(val : Float64) #

[View source]
def set_gamma(val : Float64) #

[View source]
def set_gravity(val : Float64) #

[View source]
def set_green_primary(x, y, z) #

Set the chromaticity green primary point for the image to the given x, y, and z values.


[View source]
def set_intent(val : LibMagick::RenderingIntent) #

[View source]
def set_interlace_scheme(val : LibMagick::InterlaceType) #

[View source]
def set_iterations(val : Int) #

[View source]
def set_matte(val : Bool) #

[View source]
def set_matte_color(val : Pixel) #

[View source]
def set_orientation(val : LibMagick::OrienationType) #

[View source]
def set_page(width : Int, height : Int, x : Int, y : Int) #

[View source]
def set_pixel(x : Int, y : Int, color : Pixel) #

Set the pixel at the given x and y coordinates.


[View source]
def set_pixel_interpolation_method(val : LibMagick::PixelInterpolateMethod) #

[View source]
def set_pos(index : Int) #

Sets the current position in the image set. Will always be zero for non-animated images.


[View source]
def set_property(name : String, value : String) #

Set a specific property of the image.

Example:

image = Image.new("/path/to/image.png")
image.set_property("exif:GPSLatitude", "40/1, 43/1, 54/1")

[View source]
def set_red_primary(x, y, z) #

Set the chromaticity red primary point for the image to the given x, y, and z values.


[View source]
def set_resolution(x : Float64, y : Float64) #

[View source]
def set_scen(scene : Int) #

[View source]
def set_ticks_per_second(val : Int) #

[View source]
def set_type(val : LibMagick::ImageType) #

[View source]
def set_units(val : LibMagick::ResolutionType) #

[View source]
def set_virtual_pixel_method(val : LibMagick::VirtualPixelMethod) #

[View source]
def set_white_point(x : Float64, y : Float64, z : Float64) #

[View source]
def shade(azimuth : Float64, elevation : Float64, gray : Bool = false) #

[View source]
def shadow(alpha : Float64, sigma : Float64, x : Int, y : Int) #

[View source]
def sharpen(radius : Float64, sigma : Float64) #

[View source]
def shave(width : Int, height : Int) #

[View source]
def shear(background : Pixel, x : Float64, y : Float64) #

[View source]
def sigmoidal_constrast(alpha : Float64, beta : Float64, sharpen : Bool = false) #

[View source]
def signature #

[View source]
def size #

[View source]
def sketch(radius : Float64, sigma : Float64, angle : Float64) #

[View source]
def smush(offset : Int, stack : Bool = false) #

[View source]
def solarize(threshold : Float64) #

[View source]
def sparse_color(method : LibMagick::SparseColorMethod, args : Array(Float64)) #

[View source]
def splice(width : Int, height : Int, x : Int, y : Int) #

[View source]
def spread(method : LibMagick::PixelInterpolateMethod, radius : Float64) #

[View source]
def statistic(type : LibMagick::StatisticType, width : Int, height : Int) #

[View source]
def statistics(channel : LibMagick::ChannelType) #

[View source]
def stego(watermark : Wand, offset : Int) #

[View source]
def stereo(offset : Wand) #

[View source]
def strip #

[View source]
def swirl(degrees : Float64, method : LibMagick::PixelInterpolateMethod) #

[View source]
def texture(texture : Wand) #

[View source]
def threshold(threshold : Float64) #

[View source]
def threshold_channel(channel : LibMagick::ChannelType, threshold : Float64) #

[View source]
def thumbnail(width : Int, height : Int) #

[View source]
def ticks_per_second #

[View source]
def tint(tint : Pixel, blend : Pixel) #

[View source]
def to_io #

[View source]
def to_unsafe : Pointer(LibMagick::MagickWand) #

[View source]
def to_unsafe_image #

[View source]
def total_ink_density #

[View source]
def transform_colorspace(colorspace : LibMagick::ColorspaceType) #

[View source]
def transparent_paint(target : Pixel, alpha : Float64, fuzz : Float64, invert : Bool = false) #

[View source]
def transpose #

[View source]
def transverse #

[View source]
def trim(fuzz : Float64) #

[View source]
def type #

[View source]
def units #

[View source]
def unsharp_mask(radius : Float64, sigma : Float64, gain : Float64, threshold : Float64) #

[View source]
def vignette(radius : Float64, sigma : Float64, x : Int, y : Int) #

[View source]
def virtual_pixel_method #

[View source]
def wave(amplitude : Float64, length : Float64, method : LibMagick::PixelInterpolateMethod) #

[View source]
def wavelet_denoise(threshold : Float64, softness : Float64) #

[View source]
def white_point #

[View source]
def white_threshold(threshold : Pixel) #

[View source]
def width #

Return the width of the image.


[View source]
def write(path : String) #

[View source]
def xmp #

Return XMP data for the image as a Hash(String, String).


[View source]