<doc>
	<legacy_id></legacy_id>
	<name>export with palette</name>
	<type>command</type>

	<syntax>
		<example>export <i>image</i> [with metadata <i>metadata</i>] to {file <i>filePath</i> | <i>container</i>} as {gif | png} with standard palette</example>
		<example>export <i>image</i> [with metadata <i>metadata</i>] to {file <i>filePath</i> | <i>container</i>} as {gif | png} with optimized palette</example>
		<example>export <i>image</i> [with metadata <i>metadata</i>] to {file <i>filePath</i> | <i>container</i>} as {gif | png} with <i>colorCount</i> color [optimized] palette</example>
		<example>export <i>image</i> [with metadata <i>metadata</i>] to {file <i>filePath</i> | <i>container</i>} as {gif | png} with palette <i>colorList</i></example>
	</syntax>

	<synonyms>
	</synonyms>

	<summary><glossary tag="export">Exports</glossary> the <property tag="selected">selected</property><keyword tag="image">image</keyword> as a <glossary tag="PBM">PBM</glossary>, <glossary tag="JPEG">JPEG</glossary>, <glossary tag="GIF">GIF</glossary>, BMP or <glossary tag="PNG">PNG </glossary><keyword tag="file">file</keyword>.</summary>

	<examples>
<example>export image 1 to myVariable as png with standard palette</example>
<example>export image "Parachute" to myVariable as gif with 100 color palette</example>
	</examples>

	<history>
		<introduced version="4.5">Added</introduced>
		<deprecated version=""></deprecated>
		<removed version=""></removed>
		<changed version="6.7">6.7</changed>
		<experimental version=""></experimental>
		<nonexperimental version=""></nonexperimental>
	</history>

	<objects>
	</objects>

	<platforms>
		<mac/>
		<windows/>
		<linux/>
	</platforms>

	<classes>
		<desktop/>
		<web/>
	</classes>

	<security>
		<disk/>
	</security>


	<classification>
	</classification>

	<references>
		<command tag="export snapshot">export snapshot Command</command>
		<command tag="import">import Command</command>
		<command tag="export">export Command</command>
		<property tag="JPEGQuality">JPEGQuality Property</property>
		<keyword tag="as">as Keyword</keyword>
		<keyword tag="paint">paint Keyword</keyword>
	</references>

	<description>
	<overview>Use the <b>export with palette</b> <glossary tag="command">command</glossary> to <command tag="export">export</command> an <keyword tag="image">image</keyword> to a <keyword tag="file">file</keyword> or <glossary tag="container">container</glossary> with color reduction.</overview>

		<parameters>
  <parameter>The <i>filePath</i> specifies the <glossary tag="file path">name and location</glossary> of the <keyword tag="file">file</keyword> you want to <a name="command tag=export">export</a> to. If you specify a name but not a location, the <a name="keyword tag=file">file</a> is created in the <a name="property tag=defaultFolder">defaultFolder</a>.</parameter>
  <parameter>The <i>container</i> is a reference to a <glossary tag="container">container</glossary>, usually another <keyword tag="image">image</keyword> or a <keyword tag="URL">URL</keyword>.</parameter>
  <parameter>The <i>image</i> is a reference to an <keyword tag="image">image</keyword>.</parameter>
  <parameter>The <i>colorCount</i> is an integer in the range zero to 256, or an expression evaluating to such an integer, and specifies the size of the palette to be generated.</parameter>
  <parameter>The <i>colorList</i> is a return-delimited list of up to 256 colors to be used as the palette.</parameter>	
  <parameter>The <i>metadata</i> is an array of metadata. Currently the only key supported is density with a value in pixels per inch (ppi).</parameter>
		</parameters>

	<value></value>
	<comments>The export with palette form exports an image in either PNG or GIF format with a specific size or type of palette. <p></p><p>If the <i>standard palette</i> form is used, then the image will be color-matched to the default 256 color LiveCode palette before export.</p><p></p><p>If the <i>optimized palette</i> form is used, then a palette with the <i>colorCount</i> colors will be generated that does its best to approximate all the colors present in the image. The image will be color-matched to this palette before export. If colorList is not specified, a 256 entry palette will be generated. </p><p></p><p>If the <i>palette colorList</i> form is used, the image will be color-matched to that palette before export.</p><p></p><p>If the image has any sort of transparency, then this will utilize one palette entry. In particular, if you ask for a 256 color palette with a transparent image, you may get only 255 colors.</p><p></p><p>In all cases, optional dithering will be performed as determined by its dontDither property.</p><p></p><p></p><note>It is a (relatively) slow process to compute an optimized palette and then remap an image against it; it should not be considered a real-time operation except for very small images.</note><p></p><p></p><note>There is no support for exporting a JPEG with a reduce palette as this format is for continuous-tone images and as such the notion of palette makes no sense.</note><p>&#9;</p></comments>
	</description>
</doc>