Harris Hu Posted Thursday at 11:55 AM Report Posted Thursday at 11:55 AM I received some image data from a web API in Base64 format. Is there a way to load it into LabVIEW without generating a local file? There are many images to display, and converting them to local files would be cumbersome. base64.txt is a simple example of the returned data. image/jpeg base64.txt Quote
ensegre Posted Thursday at 02:11 PM Report Posted Thursday at 02:11 PM (edited) I haven't tried any of them, but these are the first 3 results popping up from a web search: https://forums.ni.com/t5/Example-Code/LabVIEW-Utility-VIs-for-Base64-and-Base32Hex-Encoding-Using/ta-p/3491477 https://www.vipm.io/package/labview_open_source_project_lib_serializer_base64/ https://github.com/LabVIEW-Open-Source/Serializer.Addons (apparently the repo of the code of the previous one) Edited Thursday at 03:04 PM by ensegre typo Quote
ShaunR Posted Thursday at 02:19 PM Report Posted Thursday at 02:19 PM 2 hours ago, Harris Hu said: I received some image data from a web API in Base64 format. Is there a way to load it into LabVIEW without generating a local file? There are many images to display, and converting them to local files would be cumbersome. base64.txt is a simple example of the returned data. image/jpeg base64.txt 4.3 kB · 1 download LabVIEW can only draw PNG from a binary string using the PNG Data to LV Image VI. (You'd need to base64 decode the string first) I think there are some hacky .NET solutions kicking around that should be able to do JPG if you are using Windows. Quote
Neil Pate Posted Thursday at 02:28 PM Report Posted Thursday at 02:28 PM (edited) The Weather Station example that ships with LabVIEW shows a bit of this. but the data is not Base64, its just a pure characters, Edited Thursday at 02:30 PM by Neil Pate 1 Quote
ensegre Posted Thursday at 03:04 PM Report Posted Thursday at 03:04 PM As for converting jpg streams in memory, very long time ago I have used https://forums.ni.com/t5/Example-Code/jpeg-string-to-picture/ta-p/3529632 (windows only). At the end of the discussion thread there, @dadreamer refers to https://forums.ni.com/t5/Machine-Vision/Convert-JPEG-image-in-memory-to-Imaq-Image/m-p/3786705#M51129, which links to an alternative WinAPI way. Quote
Harris Hu Posted Thursday at 03:09 PM Author Report Posted Thursday at 03:09 PM 39 minutes ago, Neil Pate said: LabVIEW 自带的气象站示例就展示了这一点。 但这些数据并非Base64编码,而只是纯字符数据。 This is acceptable. Quote
ensegre Posted Thursday at 03:17 PM Report Posted Thursday at 03:17 PM You could also check https://github.com/ISISSynchGroup/mjpeg-reader which provides a .Net solution (not tried). So, who volunteers for something working on linux? 1 Quote
ShaunR Posted Sunday at 10:43 AM Report Posted Sunday at 10:43 AM (edited) On 1/8/2026 at 3:17 PM, ensegre said: You could also check https://github.com/ISISSynchGroup/mjpeg-reader which provides a .Net solution (not tried). So, who volunteers for something working on linux? There is an example shipped with LabVIEW called "Image Compression with DCT". If one added the colour-space conversion, quantization and changed the order of encoding (entropy encoding) and Huffman RLE you'd have a JPG [En/De]coder. That'd work on all platforms Not volunteering; just saying Edited Sunday at 10:57 AM by ShaunR 1 Quote
Rolf Kalbermatter Posted yesterday at 01:30 PM Report Posted yesterday at 01:30 PM On 1/11/2026 at 11:43 AM, ShaunR said: There is an example shipped with LabVIEW called "Image Compression with DCT". If one added the colour-space conversion, quantization and changed the order of encoding (entropy encoding) and Huffman RLE you'd have a JPG [En/De]coder. That'd work on all platforms Not volunteering; just saying You make it sound trivial when you list it like that. 😁 Quote
ShaunR Posted yesterday at 01:57 PM Report Posted yesterday at 01:57 PM (edited) 28 minutes ago, Rolf Kalbermatter said: You make it sound trivial when you list it like that. 😁 While we are waiting for Hooovah to give us a huffman decoder ... most of the rest seem to be here: Cosine Transform (DCT), sample quantization, and Huffman coding and here: LabVIEW Colour Lab Edited yesterday at 01:58 PM by ShaunR Quote
hooovahh Posted 3 hours ago Report Posted 3 hours ago On 1/12/2026 at 8:57 AM, ShaunR said: While we are waiting for Hooovah to give us a huffman decoder ... 😅 You might be waiting a while, I'm mostly interested in compression, not decompression. That being said in the post I made, there is a VI called Process Huffman Tree and Process Data - Inflate Test under the Sandbox folder. I found it on the NI forums at some point and thought it was neat but I wasn't ready to use it yet. It isn't complete obviously but does the walking through of bits of the tree, to bytes. EDIT: Here is the post on NI's forums I found it on. 1 Quote
Rolf Kalbermatter Posted 3 hours ago Report Posted 3 hours ago On 1/12/2026 at 2:57 PM, ShaunR said: While we are waiting for Hooovah to give us a huffman decoder ... most of the rest seem to be here: Cosine Transform (DCT), sample quantization, and Huffman coding and here: LabVIEW Colour Lab You seem to have done all the pre-research already. Are you really not wanting to volunteer? 😁 Quote
ensegre Posted 2 hours ago Report Posted 2 hours ago I haven't yet really looked into, but why not just wrapping libjpeg, instead of endeavoring the didactic exercise of G-reinventing of the wheel? Quote
ShaunR Posted 2 hours ago Report Posted 2 hours ago 19 minutes ago, Rolf Kalbermatter said: You seem to have done all the pre-research already. Are you really not wanting to volunteer? 😁 Nope. It needs someone better than I. Quote
Rolf Kalbermatter Posted 2 hours ago Report Posted 2 hours ago 6 minutes ago, ShaunR said: Nope. It needs someone better than I. I can understand that sentiment. I'm also just doing some shit that I barely can understand.🤫 Quote
ensegre Posted 2 hours ago Report Posted 2 hours ago (edited) Uhm. This is G-image. Am I missing something? Edited 2 hours ago by ensegre Quote
ShaunR Posted 1 hour ago Report Posted 1 hour ago (edited) 55 minutes ago, ensegre said: Uhm. This is G-image. Am I missing something? OP is using LV2019. Nice tool though. Shame they don't ship the C source for the DLL but they do have it on their github repository. Edited 1 hour ago by ShaunR Quote
ensegre Posted 1 hour ago Report Posted 1 hour ago 11 minutes ago, ShaunR said: OP is using LV2019. Where do you get that from? Quote
ensegre Posted 1 hour ago Report Posted 1 hour ago (edited) So in LV>=20, using OpenSerializer.Base64 and G-Image. That simple. Linux just does not have IMAQ. Well, who said that the result should be an IMAQ image? Edited 1 hour ago by ensegre Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.