> For the complete documentation index, see [llms.txt](https://docs.coherent.global/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coherent.global/build-spark-services/additional-mappings/images-ximage.md).

# Images (Ximage)

{% hint style="warning" %}
The legacy `Type3` service type includes support for this feature. [Neuron](/build-spark-services/neuron.md) only includes support for `Ximage_metadata` Base64 string images.
{% endhint %}

Syntax: `Ximage_<parameter>`

Produce images as part of the API response. This can be useful for using Spark services to feed image elements to a front-end.

1. Click on the target chart or image.
2. Use the **Name Box** to create a Name for the image, for example `Ximage_rocketchart`.
3. Upload the file to Spark and open the [API Tester](/navigation/api-tester.md).
4. **API request (inputs)** **Field view** lists all the `Ximage`s that have been defined in the workbook.
5. Next to the **Image Name** field is the **File Name** field, which corresponds to the `FileName` parameter of the API request. Enter the desired filename here, for example, `customfilename.pdf`. If no filename is provided, then a UUID is used for the filename.
6. Click **Submit** to make the API request.
7. In the **API response (outputs)** **Field view**, open the **Images** expandable.
8. Each image will be listed in the table with a link to download the image.

## Return an image as a Base64 string

Syntax: `Ximage_metadata.<parameter>`

Images can be returned as a Base64 string. This can be easier to use than an attachment when integrating the API response to a front-end. This works when the image is defined as part of the [Sub functions with subservices](/build-spark-services/additional-mappings/sub-functions-with-subservices.md#metadata-subservice).

## Return original file size images

Syntax: `Ximageoriginal_<parameter>` or `Ximageoriginal_metadata.<parameter>`

`Ximage` will return an image that has been resized based upon its dimensions in an Excel file. To return an image in its original quality and file size, use the alternative `Ximageoriginal` mapping.

* This functionality supports JPEG or PNG images but not Excel charts.
* In **File**, **Options**, **Advanced**, select **Do not compress images in file**.

## Sample file

{% file src="/files/-MdGy6aH9M4Ov40ovzyR" %}
