ImageTools - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Graphics : Image Processing : ImageTools Package : ImageTools/Preview

ImageTools

  

Preview

  

preview an image

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

Preview( img, MaxH, MaxW, opts )

Parameters

img

-

Image; the image to preview

MaxH

-

(optional) posint; desired maximum height of the preview image

MaxW

-

(optional) posint; desired maximum width of the preview image

opts

-

(optional) equation(s) of the form option = value; specify options for the Preview command

Options

• 

chars = string

  

Specifies the characters to use when the output = text option is selected. The characters should be ordered from darkest to lightest (assuming dark text on a light background). The default is "@Oo*+=~- ".

• 

method = bspline or nearest

  

Specifies the mode used to scale the image. See Scale. The default is bspline.

• 

output = image, text, or colortext

  

Specifies whether the output is an image or a textual representation of the image. If text was specified, then the characters in the chars option represent the shades of gray in the image. If colortext was specified, the "@" character is used for all pixels, with differing foreground and background colors to simulate a larger palette.

  

The default is image, unless interface(plotdevice) is char or colorchar, in which case the default is text or colortext respectively.

• 

sixteen = truefalse

  

This option only applies if output is colortext. If set to true, then only the ANSI X3.64 standard 16 colors are used (and only 8 of those as background colors). If false, then the extended 256 xterm colors are used. The latter produces much more accurate colors, but is not compatible with all terminals. By default, this option is true (16 color mode) when Maple is run under Microsoft Windows, and false (256 color mode) on all other platforms.

• 

dither = truefalse

  

This option only applies if output is colortext. If true, then simple horizontal dithering is applied to reduce the average color error. This option is true by default.

Description

• 

The Preview command generates a plot of an image and displays it in the worksheet.

• 

The img parameter is the image to be displayed.

• 

The optional parameters MaxH and MaxW are the maximum height and width, respectively, to which the preview image is scaled. The units are pixels if the output option is image; otherwise they are characters. If omitted, suitable defaults are used.

• 

The image is rescaled for previewing, and when the output option is image, is displayed with axes corresponding to the pixel coordinates of the image. This is useful in determining where to crop an image.

Examples

imagefilecatkerneloptsdatadir,/images/fjords.jpg:

withImageTools:

imgReadimagefile:

Previewimg

Previewimg,method=nearest

Previewimg,output=text

@@@@@@@@@@O@@OO@@O@@OO@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@OOOOOOOOoOOOOOOOOOOOOOOOOOOO@@@
@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoo**oOOOOOO@@OOOOOOOOO@@@@
@@@OOOOOOOOOOOOOOOOOOOOOOOO+=**+o*=*+*OOOOOOOOOOOOOOOOO@@
OOOOOO*=--=*~=O*ooo*oOOOOOO*-~oO=~+o*=~=+oO@OOOOOOOOOOOOO
OOOo=    -*o==oo=-~oooOOOOO+-==~-~+oo=~==~~~=*OOOOOOOOO@@
OO=    ---~~ ~+o+~~=*OOOOO= -~---~=++=~~++==~~=*OOOOOOOOO
*~  -----    -=*+=~=*OOOO*- ---~~==+=~~~=+++==~~+oOOOO@@O
- ------   - -~++===*OOOOo~ -~~~~=+++=~~~=++++==~=oOOOOOO
~------   -==~~=*+*****ooo~-~~==+O@*==~=====+++===*OOOOO@
+=-----   -++==+**oOo++=~~-~=+++**++=======+++++===+OOOOO
*+~-~--    ~=++*ooooOOOOOo++**++**+=========+++==+++++++O
o*=~~-     ~=+*oOOooOOOOo+********++==~=+====++===++++++o
o*+~~-    -~~=*oOOoooOO*--=+*****+++==~=+========+*++++==
**+==-    -~---=+++*oO+  ~=~~=++++++===++======++++++++==
***++=-  -~=--~-~=+=~===+Oo=~~=+++*++++++======++++*+++==
*+**+++=~~=+=+O*+oOooo**oO+===+++**=+*++++====+++*++++++=
**++***++=+*+-*OOO++***+****+*oOoOO-=+++++====++***+++++=
o**+++**+++++=*@@o~-----~++=o*o@O@@+~==+++====+++++++++++
o**+++****++++=~~--       ~*+-o@O@@O==+++++==++++++++++=+
Oo**+++***++++=-----     =*+ -oOo@@@+-=++++++++++++++++==
oo**+++****+++-      ---=*Oo-~oOO@@@+ -~=++++++++++++++==
*o**********+=         =*+oo==oO@@@@+  -~===++++++++++++=
************+~        ++  oo ~o@@@@@+~--~~~=+++++++++++==

PreviewCheckerboard10,4,4,20,20,chars=* ,output=text

     *****     *****
     *****     *****
     *****     *****
*****     *****     
*****     *****     
*****     *****     
     *****     *****
     *****     *****
     *****     *****
*****     *****     
*****     *****     
*****     *****     

Compatibility

• 

The ImageTools[Preview] command was updated in Maple 2019.

• 

The sixteen and dither options were introduced in Maple 2019.

• 

The output option was updated in Maple 2019.

• 

For more information on Maple 2019 changes, see Updates in Maple 2019.

See Also

ImageTools

ImageTools[View]

ImageTools[Write]