Preview - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


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

withImageTools:

imgSampleImage4:

Previewimg

Previewimg,method=nearest

Previewimg,output=text

OOOOOOoo*+++**~~=+*oo*+=++==+****+++++==~=+
OOOOOOOOoo**o*=~~~~=+***+++++*++++++***+++*
OOOOOOOOO*+**+===~~~~=++=~~===~~=~~=++++=++
OOOOOOOOOooo*++*+==~---~~~-~~~~~~~~~====+++
OOOOoOOOOOoo*****==~~~~~~==================
OOOOooOOOo*++*oo*++++=~====+======+========
OOOooooo+~=   =***oo*+==~~========+++++=++=
oOOOo*o*- =*+~ --+ooo**+====+=~~==~~=====++
*OOOOoo*=-=*@@@*~=*ooo**+========~===~=++++
*oooOo*+~-~~o@@@+-=oooo****+++==========+++
*o**oo*~    =o@@+  =ooooooo***++===++++====
*oooo*+-     =**=  ~oooooo**********+**===+
**oo**+-   -~===-  -*o*+++++++++++**+====++
*o****+- --~====~- ~++~----~~~~~~=====+++++
oooooo+----~~==+++=+***+++**o*******+===+++
+**ooo+------~===++++*oOOo**oOOooOOOOo~-++*
++*ooo*---~---~-  -=~=oO@OOoooOOOOOOO@o=**o
oooOOO*- --- -    ~o*=*oO@@@@OOO@OOOO@@oooO
+*++*o*-      -~~~=++=*OO@@@@@OO@@OO@@@OoOO
==++*oo=-   -~+oo*+=+*oO@@@@@@@OOOOO@@@OoOo
-~--~*Oo*=~=*O@@@Oo=oooO@@@@@@@OOOOO@@@Oooo
--- ~o@@OO@@@@@@@@o+oooo@@@@@@@OOO@O@@@@o*+
-   -o@@@@@@@@@@@@o+OOoO@OOO@@@OOOOOO@@O*~-
     *@@@@@@@@@O@O*o@OOOOO@@@@OooOOO@@@O+-=
     ~oO@@@@@@@@OO+O@OOooo@@@@OOooOO@@@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]