COM Object: ImageMagickObject COM+ Object
Purpose: ImageMagick® is a software suite to create, edit, and compose bitmap images.
System Requirements: ImageMagickObject COM+ Object
Documentation Link:
Other Links: http://www.imagemagick.org/script/binar ... hp#windows
Basic Code Example:
Code: Select all
oI := ComObjCreate("ImageMagickObject.MagickImage.1")
imgs := Object()
Loop, 16 {
filename := "plasma" . A_Index . ".jpg"
oI.convert("-size", "200x200", "plasma:", filename)
imgs.Insert(filename)
}
imgs.Insert("montage.jpg")
stitch(oI, imgs*)
stitch(obj, params*) {
obj.montage("-geometry", "+0+0", params*)
}
oI.convert("montage.jpg", "-verbose", "info:image_info.txt")
oI.convert("montage.jpg", "-define", "histogram:unique-colors=false", "histogram:histogram.gif") ; create histogram
FileRead, info, image_info.txt
FileDelete, image_info.txt
MsgBox % info
Convert image to text:
Code: Select all
oI := ComObjCreate("ImageMagickObject.MagickImage.1")
oI.convert("montage.jpg", "montage.txt")
Output:
Code: Select all
# ImageMagick pixel enumeration: 40,40,255,rgb
0,0: (235,241,255) #EBF1FF rgb(235,241,255)
1,0: (221,242,237) #DDF2ED rgb(221,242,237)
2,0: (219,253,226) #DBFDE2 rgb(219,253,226)
3,0: (192,225,208) #C0E1D0 rgb(192,225,208)
4,0: (202,224,237) #CAE0ED rgb(202,224,237)
5,0: (223,232,255) #DFE8FF rgb(223,232,255)
6,0: (224,220,245) #E0DCF5 rgb(224,220,245)
7,0: (240,223,239) #F0DFEF rgb(240,223,239)
8,0: (255,240,251) #FFF0FB rgb(255,240,251)
9,0: (244,253,255) #F4FDFF rgb(244,253,255)
10,0: (188,228,230) #BCE4E6 rgb(188,228,230)
11,0: (192,239,245) #C0EFF5 rgb(192,239,245)
12,0: (209,236,255) #D1ECFF rgb(209,236,255)
13,0: (232,235,255) #E8EBFF rgb(232,235,255)
14,0: (235,237,255) #EBEDFF rgb(235,237,255)
15,0: (213,225,237) #D5E1ED rgb(213,225,237)
16,0: (230,237,245) #E6EDF5 rgb(230,237,245)
17,0: (230,249,255) #E6F9FF rgb(230,249,255)
...
Get information about a single pixel of an image:
Code: Select all
; http://www.imagemagick.org/script/fx.php
oI := ComObjCreate("ImageMagickObject.MagickImage.1")
r := oI.identify("-format", "%[fx]", "montage.jpg")
MsgBox % r
Notes:
I sometimes need to automatically stitch images together.
I used
GflAx previously, but there had to calculate canvas size and positioning myself.
Now ImageMagick does the job for me.
The scope of ImageMagick is endless. Explore!