Difference between revisions of "ImageMagick"

From TheAlmightyGuru
Jump to: navigation, search
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
[[Image:ImageMagick - Logo.png|thumb|256x256px|ImageMagick logo.]]
 
[[Image:ImageMagick - Logo.png|thumb|256x256px|ImageMagick logo.]]
  
'''ImageMagick''' is a [[freeware|free]] [[open source]] cross-platform image editing program that uses a scripting language to create, edit, and convert between over 200 different image formats. It can be run in various forms including a command-line program, being invoked through OLE, as a PHP module, and various others.
+
'''ImageMagick''' is a [[freeware|free]] [[open source]] cross-platform image editing program written in [[C]] which uses a custom scripting language to create, edit, and convert between over 200 different image formats. It can be run in various forms including a command-line program, as a PHP module, and various others.
 +
 
 +
==Personal==
 +
I discovered ImageMagick around 2010 when I started working with [[MediaWiki]] and [[PHP]] programming, but I didn't really do much with it at that time. When I learned about its command line capabilities I began writing simple scripts for it to process images in batch, something I could never get the hang of in most graphic editors. When I discovered it had OLE support in 2017, I wrote dozens of JScript programs to utilize it. However, support for OLE was dropped in 2022, so I began writing a new front end called [[ImageMagick Tools]].
  
 
==Using Imagemagick==
 
==Using Imagemagick==
Line 10: Line 13:
  
 
===OLE Invocation===
 
===OLE Invocation===
By default, ImageMagick is not installed with OLE support, but it can be turned on in the installer by checking on the '''Install ImageMagickObject OLE Control for VBscript Visual Basic, and WSH''' box. Once installed in this way, you can access it using any program with OLE support. Here is a [[JScript]] example that creates a square JPEG image using the OLE module.
+
OLE support has been removed from ImageMagick with the last supported version being 7.1.0-19. There is no longer a script replacement, you are now forced to use interface to ImageMagick through a .NET programming language. You used to be able to activate OLE support in the installer by checking on the '''Install ImageMagickObject OLE Control for VBscript Visual Basic, and WSH''' box. Once installed in this way, you can access it using any program with OLE support. Here is a [[JScript]] example that creates a square JPEG image using the OLE module.
  
 
<pre>
 
<pre>
Line 20: Line 23:
 
</pre>
 
</pre>
  
==Scripts==
+
Here are all my old [[Media:Imagemagick JScripts.zip|ImageMagick JScript programs]] which you can use if you still have an old version of ImageMagick.
* [[Media:Imagemagick JScripts.zip|Download]] ([[:File:Imagemagick JScripts.zip|Info]]) - A collection of JScript programs that perform basic ImageMagick functions like rotation, format conversion, blurring, etc.
+
 
 +
==See Also==
 +
* [[ImageMagick Tools]]
  
 
==Links==
 
==Links==
Line 33: Line 38:
 
[[Category: Graphic Software]]
 
[[Category: Graphic Software]]
 
[[Category: Useful Software]]
 
[[Category: Useful Software]]
 +
[[Category: Android Software]]
 +
[[Category: iOS Software]]
 +
[[Category: Linux Software]]
 +
[[Category: Macintosh Software]]
 
[[Category: Windows Software]]
 
[[Category: Windows Software]]
 
[[Category: Software Distribution Model - Freeware]]
 
[[Category: Software Distribution Model - Freeware]]
[[Category: Software Distribution Model - Open Source]]
+
[[Category: Software Distribution Model - Open source]]

Latest revision as of 12:09, 8 March 2024

ImageMagick logo.

ImageMagick is a free open source cross-platform image editing program written in C which uses a custom scripting language to create, edit, and convert between over 200 different image formats. It can be run in various forms including a command-line program, as a PHP module, and various others.

Personal

I discovered ImageMagick around 2010 when I started working with MediaWiki and PHP programming, but I didn't really do much with it at that time. When I learned about its command line capabilities I began writing simple scripts for it to process images in batch, something I could never get the hang of in most graphic editors. When I discovered it had OLE support in 2017, I wrote dozens of JScript programs to utilize it. However, support for OLE was dropped in 2022, so I began writing a new front end called ImageMagick Tools.

Using Imagemagick

Command Line

This command line script will take a folder full of JPEGs and make a PDF document out the them where each page of the PDF has a single image centered on the page. The page size specified here yields a standard letter size (8.5" x 11") at 72 DPI.

magick *.jpg -gravity center -extent 612x792 -density 72 output.pdf

OLE Invocation

OLE support has been removed from ImageMagick with the last supported version being 7.1.0-19. There is no longer a script replacement, you are now forced to use interface to ImageMagick through a .NET programming language. You used to be able to activate OLE support in the installer by checking on the Install ImageMagickObject OLE Control for VBscript Visual Basic, and WSH box. Once installed in this way, you can access it using any program with OLE support. Here is a JScript example that creates a square JPEG image using the OLE module.

var oIM = new ActiveXObject("ImageMagickObject.MagickImage.1");
oIM.convert("-size", "512x512", "xc:white", 
 "-fill", "white", "-stroke", "black", "-draw", "rectangle 0,0 511,511", 
 "-fill", "blue", "-stroke", "none", "-font", "Tahoma", "-pointsize", "48", "-gravity", "center", "-draw", "text 0,0 'Square'", 
 "-quality", "90%", "Square.jpg");

Here are all my old ImageMagick JScript programs which you can use if you still have an old version of ImageMagick.

See Also

Links

Link-Wikipedia.png  Link-Official.png