# How to show binary image data from database on Vision Image component?

**URL:** <https://forum.inductiveautomation.com/t/how-to-show-binary-image-data-from-database-on-vision-image-component/75002>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [June 14, 2023, 8:26am UTC](https://forum.inductiveautomation.com/t/how-to-show-binary-image-data-from-database-on-vision-image-component/75002 "2023-06-14T08:26:21Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Hayden\_Watson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hayden_watson/32/48792_2.png) [@Hayden\_Watson](https://forum.inductiveautomation.com/u/Hayden_Watson)\
**Post date:** [June 14, 2023, 10:02am UTC](https://forum.inductiveautomation.com/t/how-to-show-binary-image-data-from-database-on-vision-image-component/75002/2 "2023-06-14T10:02:12Z")

</div>

Look up this thread, might be useful:

> [@Converting blob to image](https://forum.inductiveautomation.com/t/converting-blob-to-image/57853):
>
> Hi. Im using script to store filedata as varbinary(max) in mssqlserver. but the problems comes when im trying to display the image in perspective. im copying some of the scrips i see in some related topics I’m using this query to select and convert the blob to base64: SELECT CAST(’’ as xml).value(‘xs:base64Binary(sql:column(“filedata”))’, ‘varbinary(MAX)’) FROM files WHERE filename = ‘04E.JPG’ then this script transform to display the image: b64Image = “data:image/jpeg;base64,%s”%val…

---

_[View the full topic](https://forum.inductiveautomation.com/t/how-to-show-binary-image-data-from-database-on-vision-image-component/75002)._
