mglib

Personal IDL library for M. Galloy

single page | use frames     summary     class     fields     routine details     file attributes

vis/util/

mg_convert.pro

system utility

includes main-level program

Use ImageMagick to convert a file between formats. To specify the location of the convert command from the ImageMagick utilities, do one of the following:

1. set the CONVERT_LOCATION keyword 2. set the !convert_location system variable 3. place convert in the OS PATH

Examples

Try the main-level program at the end of this file:

IDL> .run mg_convert

Routines

Routines from mg_convert.pro

result = mg_convert_read_image(filename)

Attempt to read an image file.

mg_convert [, basename] [, density=long] [, max_dimensions=lonarr(2)] [, scale=long] [, /retina] [, from_extension=string] [, /from_eps] [, /from_png] [, /from_ps] [, to_extension=string] [, /to_eps] [, /to_png] [, /to_ps] [, command=string] [, output=bytarr] [, convert_location=string] [, /keep_output] [, /cleanup]

Use ImageMagick to convert a file between formats.

Routine details

top mg_convert_read_image

result = mg_convert_read_image(filename)

Attempt to read an image file.

Return value

image or -1L if format not supported

Parameters

filename in required type=string

filename of file to read

top mg_convert

mg_convert [, basename] [, density=long] [, max_dimensions=lonarr(2)] [, scale=long] [, /retina] [, from_extension=string] [, /from_eps] [, /from_png] [, /from_ps] [, to_extension=string] [, /to_eps] [, /to_png] [, /to_ps] [, command=string] [, output=bytarr] [, convert_location=string] [, /keep_output] [, /cleanup]

Use ImageMagick to convert a file between formats.

Parameters

basename in optional type=string

basename of file to convert (used for output name as well)

Keywords

density in optional type=long default=300

density of output image in dots per inch

max_dimensions in optional type=lonarr(2)

maximum dimensions for the output image in pixels

scale in optional type=long default=100

scale percentage to use

retina in optional type=boolean

set to double default density to 600 dpi and double MAX_DIMENSIONS value

from_extension in optional type=string

extension to use for input file

from_eps in optional type=boolean

if set, indicates the input is a Encapsulated PostScript file

from_png in optional type=boolean

if set, indicates the input is a PNG file

from_ps in optional type=boolean

if set, indicates the input is a PostScript file

to_extension in optional type=string

extension to use for output file

to_eps in optional type=boolean

if set, indicates the output should a Encapsulated Postscript file

to_png in optional type=boolean

if set, indicates the output should a PNG image file

to_ps in optional type=boolean

if set, indicates the output should a Postscript file

command out optional type=string

convert command

output out optional type=bytarr

output image if output format is an image type, output image file is automatically removed if this is present

convert_location in optional type=string

location of the convert command

keep_output in optional type=boolean

set to keep output file even if OUTPUT is present

cleanup in optional type=boolean

set to remove input file

File attributes

Modification date: Wed May 21 15:14:34 2014
Lines: 99
Docformat: rst rst
Personal library of Michael Galloy
Contact me if you have enhancement requests or bug fixes.