class

CryMagick::Image

Inherits Reference / Object

Constructors

new(path : String, tempfile : Nil | File = nil)
Source

Class methods

build(path : String, tempfile = nil, &)
Source
create(ext : String = "", validate : Bool = Configuration.validate_on_create, &)

Creates tempfile and yields it for writing.

Source
import_pixels(blob : Array(Int), columns : Int, rows : Int, depth : Int, map : String | Symbol, format : String = "png")
Source
import_pixels(blob : Slice(Int), columns : Int, rows : Int, depth : Int, map : String | Symbol, format : String = "png")
Source
open(path : String, ext : String | Nil = nil)

Creates new Image from given path

TODO: allow to pass url

Source
read(file : String, ext : String = "")

Reads given string-based file with optional extension.

Source
read(file : IO, ext : String = "")
Source

Instance methods

==(other : Image)
Source
[](value)
Source
collapse!(frame : Int32 = 0)
Source
colorspace
Source
combine_options
Source
composite(other_image, output_ext = type.downcase, mask : String | Nil = nil, &)
Source
composite(other_image, output_ext = type.downcase, mask : String | Nil = nil)
Source
data
Source
destroy!
Source
details
Source
dimensions
Source
exif
Source
format(_format, page : String | Int = "0", read_options : Hash(String, String) = {} of String => String, &)

This is used to change the format of the image. That is, from "tiff to jpg" or something like that.

Once you run it, the instance is pointing to a new file with a new extension!

DANGER: This renames the file that the instance is pointing to. So, if you manually opened the file with Image.new(file_path)... Then that file is DELETED! If you used Image.open(file) then you are OK. The original file will still be there. But, any changes to it might not be...

page = -1 for all frames

TODO: fix converting several frames - point current image to first one (now it points to empty img)

Source
format(_format, page : String = "0", read_options : Hash(String, String) = {} of String => String)
Source
frames
Source
get_pixels
Source
hash

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.

Source
height
Source
human_size
Source
identify
Source
identify
Source
layer?
Source
layers
Source
mime_type
Source
mogrify(page : Int32 | Nil = nil)
Source
mogrify(page : Int32 | Nil = nil, &)
Source
pages
Source
path
Source
resolution(unit : String = "")
Source
run_command(tool_name : String, *args)
Source
signature
Source
size
Source
tempfile
Source
tempfile!
Source
type
Source
valid?
Source
validate!
Source
width
Source
write(output_to : String)
Source
write(output : IO)
Source

Macros

attribute(name, key = nil)
Source
method_missing(call)
Source

Nested types