image2strbase64

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Images
Introduced first in SolidGeometry 5.4, Creation date: 2024-07-14, Last change: 2025-09-15

creates an base64 string to integrate images direcdtly into html files



See Also: str2codelines , hexstr2str , hexstr2uint8 , str2hexsstr , mfile2mlxfile4markup

Example Illustration

 missing image of image2strbase64(fname,width)

Syntax

str=image2strbase64(fname,[width])

Input Parameter

fname: filename, weblink oder image array
width: desired with for rescale/resize

Output Parameter

str: base64 string

Examples


image2strbase64("https://www.mec.ed.tum.de/fileadmin/w00cbp/mimed/Matlab_Toolboxes/SGPIC/SGPIC_4027.JPG",320) % call using an url to an image
image2strbase64("/Volumes/LUETH-WIN/WIN AIM Matlab Libraries/WIN AIM Matlab Datenbank Lueth PICS/SGPIC_3919.JPG") % call using a file
I=webread("https://www.mec.ed.tum.de/fileadmin/w00cbp/mimed/Matlab_Toolboxes/SGPIC/SGPIC_4027.JPG");
image2strbase64(I,640) % call using an image




Copyright 2024-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Last html export of this page out of FM database by TL: 2025-09-21