# Keep original Image Names

**URL:** <http://forum.squareline.io/t/keep-original-image-names/845>\
**Category:** Feature requests\
**Created:** [February 1, 2023, 5:19pm UTC](http://forum.squareline.io/t/keep-original-image-names/845 "2023-02-01T17:19:58Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![CodeGrue](http://forum.squareline.io/letter_avatar_proxy/v4/letter/c/4491bb/32.png) [@CodeGrue](http://forum.squareline.io/u/CodeGrue)\
**Post date:** [February 1, 2023, 5:19pm UTC](http://forum.squareline.io/t/keep-original-image-names/845/1 "2023-02-01T17:19:58Z")

</div>

Currently the exported image names get changed to seemingly random names such as ui\_img\_260456555\_data. Can we have a setting to keep the original name? I need to load images at runtime and can’t reliably pick the correct ones.

---

<div class="post-metadata">

**Author:** ![kisvegabor](http://forum.squareline.io/user_avatar/forum.squareline.io/kisvegabor/32/537_2.png) [@kisvegabor](http://forum.squareline.io/u/kisvegabor)\
**Post date:** [February 3, 2023, 1:48pm UTC](http://forum.squareline.io/t/keep-original-image-names/845/2 "2023-02-03T13:48:16Z")

</div>

It shouldn’t happen. The name of the image variables should be created from the PNG’s filename. Are there non-ASCII characters in the image file names?

---

<div class="post-metadata">

**Author:** ![CodeGrue](http://forum.squareline.io/letter_avatar_proxy/v4/letter/c/4491bb/32.png) [@CodeGrue](http://forum.squareline.io/u/CodeGrue)\
**Post date:** [February 4, 2023, 4:52pm UTC](http://forum.squareline.io/t/keep-original-image-names/845/3 "2023-02-04T16:52:06Z")

</div>

No unusual charaacters. Here are a few examples.

// IMAGE DATA: assets\icon\_conditions\_thunderstorm-24x24.png  
const LV\_ATTRIBUTE\_MEM\_ALIGN uint8\_t ui\_img\_260456555\_data[] = {

// IMAGE DATA: assets\icon\_humidity-24x24.png  
const LV\_ATTRIBUTE\_MEM\_ALIGN uint8\_t ui\_img\_282688504\_data[] = {

// IMAGE DATA: assets\icon\_pressure-24x24.png  
const LV\_ATTRIBUTE\_MEM\_ALIGN uint8\_t ui\_img\_865334226\_data[] = {

---

<div class="post-metadata">

**Author:** ![CodeGrue](http://forum.squareline.io/letter_avatar_proxy/v4/letter/c/4491bb/32.png) [@CodeGrue](http://forum.squareline.io/u/CodeGrue)\
**Post date:** [February 5, 2023, 1:51am UTC](http://forum.squareline.io/t/keep-original-image-names/845/4 "2023-02-05T01:51:45Z")

</div>

it seems like having a dash (“-”) in the filename causes this. Not sure why that would be considered a restricted character. Maybe it’s a bug?

---

<div class="post-metadata">

**Author:** ![kisvegabor](http://forum.squareline.io/user_avatar/forum.squareline.io/kisvegabor/32/537_2.png) [@kisvegabor](http://forum.squareline.io/u/kisvegabor)\
**Post date:** [February 6, 2023, 11:52am UTC](http://forum.squareline.io/t/keep-original-image-names/845/5 "2023-02-06T11:52:09Z")

</div>

The file name and variable name will be the same, and `-` can’t be used in variable names. In this case SLS generates a hash for the file name.

So you should replace `-` with `_`.

---

<div class="post-metadata">

**Author:** ![CodeGrue](http://forum.squareline.io/letter_avatar_proxy/v4/letter/c/4491bb/32.png) [@CodeGrue](http://forum.squareline.io/u/CodeGrue)\
**Post date:** [February 6, 2023, 2:49pm UTC](http://forum.squareline.io/t/keep-original-image-names/845/6 "2023-02-06T14:49:15Z")

</div>

Got it. Thank you.

---

<div class="post-metadata">

**Author:** ![Richard](http://forum.squareline.io/user_avatar/forum.squareline.io/richard/32/1129_2.png) [@Richard](http://forum.squareline.io/u/Richard)\
**Post date:** [August 21, 2026, 4:44pm UTC](http://forum.squareline.io/t/keep-original-image-names/845/7 "2026-08-21T16:44:56Z")

</div>

It might be nice if SquareLine studio could escape or convert these image names to C identifiers automatically, and only fallback to a synthetic ID if the C identifier collided or otherwise wouldn’t work.

---

<div class="post-metadata">

**Author:** ![SquareLine\_Support](http://forum.squareline.io/user_avatar/forum.squareline.io/squareline_support/32/47_2.png) [@SquareLine\_Support](http://forum.squareline.io/u/SquareLine_Support)\
**Post date:** [August 24, 2026, 8:52am UTC](http://forum.squareline.io/t/keep-original-image-names/845/8 "2026-08-24T08:52:49Z")

</div>

Hi, thanks for the suggestion. We’ll add this functionality in the next SquareLine Studio release.

---

<div class="post-metadata">

**Author:** ![Richard](http://forum.squareline.io/user_avatar/forum.squareline.io/richard/32/1129_2.png) [@Richard](http://forum.squareline.io/u/Richard)\
**Post date:** [October 16, 2026, 9:14pm UTC](http://forum.squareline.io/t/keep-original-image-names/845/9 "2026-10-16T21:14:51Z")

</div>

Just noting that the hyphenated image numbering scheme changed between SquareLine 1.6.1 and 1.6.2. Looking forward to kinder handling of these. Thanks as always SLS team!

---

<div class="post-metadata">

**Author:** ![SquareLine\_Support](http://forum.squareline.io/user_avatar/forum.squareline.io/squareline_support/32/47_2.png) [@SquareLine\_Support](http://forum.squareline.io/u/SquareLine_Support)\
**Post date:** [October 20, 2026, 3:19am UTC](http://forum.squareline.io/t/keep-original-image-names/845/10 "2026-10-20T03:19:16Z")

</div>

Hi Richard, thanks for following up, and sorry this took longer than we said. The readable naming didn’t make it into 1.6.2, but it’s done and will be in the next release:

- Image file names are converted to C identifiers automatically: any character other than a letter, digit or underscore becomes `_`. So `icon_humidity-24x24.png` becomes `ui_img_icon_humidity_24x24_png`.
- The same applies to image sequences: `loader-01.png`, `loader-02.png`… give `ui_imgset_loader_`.
- A numeric ID is only used if two files would end up with the same name (e.g. `icon-a.png` and `icon_a.png`). Even then, the file that already had a valid name keeps it, and the number is now computed from the file path, so it won’t change between versions.

One heads-up: after updating, the hyphenated images will get these new names instead of `ui_img_<number>`, so if you reference them in your own code, you’ll need to update those references once.
