# 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:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Umesh\_Shinde](https://avatars.discourse-cdn.com/v4/letter/u/b5a626/32.png) [@Umesh\_Shinde](https://forum.inductiveautomation.com/u/Umesh_Shinde)\
**Post date:** [June 14, 2023, 8:26am UTC](https://forum.inductiveautomation.com/t/how-to-show-binary-image-data-from-database-on-vision-image-component/75002/1 "2023-06-14T08:26:21Z")

</div>

I am trying to show binary image data from Database on ignition vision image component.

---

<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…

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [June 14, 2023, 10:26am UTC](https://forum.inductiveautomation.com/t/how-to-show-binary-image-data-from-database-on-vision-image-component/75002/3 "2023-06-14T10:26:57Z")

</div>

[system.file.writeFile](https://docs.inductiveautomation.com/display/DOC81/system.file.writeFile) will convert the blob to an actual file. From there, you can do with it whatever you want. In your case, you just want to supply the path to your image component.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 14, 2023, 12:31pm UTC](https://forum.inductiveautomation.com/t/how-to-show-binary-image-data-from-database-on-vision-image-component/75002/4 "2023-06-14T12:31:43Z")

</div>

> [@justinedwards.jle](#):
>
> convert the blob to an actual file

That's a terrible idea for this task. Numerous efficient solutions are posted on this forum that use the paintable canvas and take the blob data directly from a dataset.
