imdata

converts the image file content into data URI scheme (RFC-2397)
67 Downloads
Updated 5 Nov 2018

View License

Use this script to convert image files into data URI scheme so that the image itself can be embedded into the image tag.

>> data = imdata('foo.png');
>> html = ['<img src="' data "'>'];

>> html

'<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...">'

Cite As

Thomas Spriestersbach (2026). imdata (https://www.mathworks.com/matlabcentral/fileexchange/69332-imdata), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2018b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Call Web Services from MATLAB Using HTTP in Help Center and MATLAB Answers
Tags Add Tags
Version Published Release Notes
1.0.0