<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Extract String Representation of an Image in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Extract-String-Representation-of-an-Image/m-p/880743#M104450</link>
    <description>&lt;P&gt;I figured out what to do.&amp;nbsp; Here I have images in my data table dt.&amp;nbsp; Pulling the value of the cell created a picture object, but I found a way around that.&amp;nbsp; I kept trying to use expressions and failing.&amp;nbsp; Then I remembered that parsing a string has essentially the same effect as defining an expression.&amp;nbsp; Now I can fairly cleanly send images from JMP to Python.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here ( 1 );
r = Parse( Char( dt:Image[11] ) );
f = Arg( Arg( r, 1 ) );
h = Encode64 Blob( Char to Blob( f, "base64compressed" ) );
Python Submit( Eval Insert( "\[
import base64
import io
from PIL import Image
pic = '''☺h☺'''
imgdata = base64.standard_b64decode(pic)
img = Image.open(io.BytesIO(imgdata))
img.show()
]\", "☺"
) );

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 20 Jun 2025 21:11:15 GMT</pubDate>
    <dc:creator>mmarchandFSLR</dc:creator>
    <dc:date>2025-06-20T21:11:15Z</dc:date>
    <item>
      <title>Extract String Representation of an Image</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-String-Representation-of-an-Image/m-p/880733#M104449</link>
      <description>&lt;P&gt;Is there a better way to get the string from New Image() than converting the expression to a string and extracting?&amp;nbsp; It just feels sloppy.&amp;nbsp; Arg() doesn't work with "Picture" objects.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here ( 1 );
g = New Image( Char To Blob( "blahblahblob", "base64compressed" ) );
f = Substr( Char( g ), Contains( Char( g ), "\!"") + 1, Contains( Char( g ), "\!", \!"base64" ) - ( Contains( Char( g ), "\!"") + 1 ) );
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Jun 2025 20:49:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-String-Representation-of-an-Image/m-p/880733#M104449</guid>
      <dc:creator>mmarchandFSLR</dc:creator>
      <dc:date>2025-06-20T20:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Extract String Representation of an Image</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-String-Representation-of-an-Image/m-p/880743#M104450</link>
      <description>&lt;P&gt;I figured out what to do.&amp;nbsp; Here I have images in my data table dt.&amp;nbsp; Pulling the value of the cell created a picture object, but I found a way around that.&amp;nbsp; I kept trying to use expressions and failing.&amp;nbsp; Then I remembered that parsing a string has essentially the same effect as defining an expression.&amp;nbsp; Now I can fairly cleanly send images from JMP to Python.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here ( 1 );
r = Parse( Char( dt:Image[11] ) );
f = Arg( Arg( r, 1 ) );
h = Encode64 Blob( Char to Blob( f, "base64compressed" ) );
Python Submit( Eval Insert( "\[
import base64
import io
from PIL import Image
pic = '''☺h☺'''
imgdata = base64.standard_b64decode(pic)
img = Image.open(io.BytesIO(imgdata))
img.show()
]\", "☺"
) );

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jun 2025 21:11:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-String-Representation-of-an-Image/m-p/880743#M104450</guid>
      <dc:creator>mmarchandFSLR</dc:creator>
      <dc:date>2025-06-20T21:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: Extract String Representation of an Image</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-String-Representation-of-an-Image/m-p/880777#M104453</link>
      <description>&lt;P&gt;I did something similar here&amp;nbsp;&lt;LI-MESSAGE title="HTML with Embedded Images" uid="483286" url="https://community.jmp.com/t5/Uncharted/HTML-with-Embedded-Images/m-p/483286#U483286" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-blog-thread lia-fa-icon lia-fa-blog lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;(see my reply) when I wanted a static .html without the gfx folder JMP usually creates.&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
cur_pic = New Image("$SAMPLE_IMAGES/windmap.png");
base64compressed_str = Arg(Arg(parse(Char(cur_pic)), 1), 1);
base64_str = Encode64 Blob(Gzip Uncompress(Char To Blob(base64compressed_str, "base64compressed")));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;To my understanding, this should get easier for JMP's Python integration in JMP19.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jun 2025 04:55:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-String-Representation-of-an-Image/m-p/880777#M104453</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-06-21T04:55:10Z</dc:date>
    </item>
  </channel>
</rss>

