# Use Custom Images

#### Using Custom Ticket Images in SS-LuckyTicket with Base64 Encoding

To use custom images for the scratch tickets in *SS-LuckyTicket*, follow these steps to convert your images to Base64 format and update the `imageDataScript.js` file accordingly.

**Step 1: Convert Custom Images to Base64**

1. **Prepare Your Images**: Design or select custom images for each ticket type (e.g., Bronze, Silver, Gold). Save these images in `.png` or `.jpg` format.
2. **Convert to Base64**:
   * Use an online tool, like [base64-image.de](https://www.base64-image.de/) or [Image to Base64](https://www.base64encode.org/), to convert each image.
   * Upload the image to the tool, generate the Base64 code, and copy the resulting string.

**Step 2: Update `imageDataScript.js`**

In `imageDataScript.js`, each ticket type (`luckyticket`, `luckyticket2`, etc.) has its Base64 image data stored as a string.

1. **Locate the Ticket Definitions**:
   * You’ll see entries like `imageData["luckyticket"]`, `imageData["luckyticket2"]`, etc.
   * Each entry holds a Base64 string that represents the image for that specific ticket.
2. **Replace Base64 Strings**:
   * Replace the existing Base64 string with your new custom Base64-encoded image data. Ensure you keep the `data:image/png;base64,` prefix, as shown in the existing structure.

Example for updating the Bronze Ticket (luckyticket):

{% code overflow="wrap" %}

```javascript
imageData["luckyticket"] = 'data:image/png;base64, <Your Custom Base64 Data Here>';
imageData["luckyticket2"] = 'data:image/png;base64, <Your Custom Base64 Data Here>';
imageData["luckyticket3"] = 'data:image/png;base64, <Your Custom Base64 Data Here>';
```

{% endcode %}

Replace `<Your Custom Base64 Data Here>` with the Base64 string from your converted image.

**Step 3: Save and Test**

1. **Save Changes**: After pasting your new Base64 strings, save `imageDataScript.js`.
2. **Restart the Resource**: Restart *SS-LuckyTicket* or the server to apply changes.
3. **Verify in Game**: Check each ticket type in the game to ensure the custom images display as expected.

***

Following these steps will allow users to replace the default ticket images with their own custom designs in *SS-LuckyTicket*.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sirecstudio.com/ss-luckyticket/use-custom-images.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
