<?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 JSL- get values of pixels in 0-255 in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-get-values-of-pixels-in-0-255/m-p/435533#M68468</link>
    <description>&lt;P&gt;Hi all, I am trying to get pixel values in 0-255 using Get Pixels().&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;{r, g, b} = img &amp;lt;&amp;lt; Get Pixels("rgb");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This gives me normalized values (0-1). How can I get the pixel values in 0-255?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 18:04:55 GMT</pubDate>
    <dc:creator>LR237787</dc:creator>
    <dc:date>2023-06-09T18:04:55Z</dc:date>
    <item>
      <title>JSL- get values of pixels in 0-255</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-get-values-of-pixels-in-0-255/m-p/435533#M68468</link>
      <description>&lt;P&gt;Hi all, I am trying to get pixel values in 0-255 using Get Pixels().&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;{r, g, b} = img &amp;lt;&amp;lt; Get Pixels("rgb");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This gives me normalized values (0-1). How can I get the pixel values in 0-255?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 18:04:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-get-values-of-pixels-in-0-255/m-p/435533#M68468</guid>
      <dc:creator>LR237787</dc:creator>
      <dc:date>2023-06-09T18:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: JSL- get values of pixels in 0-255</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-get-values-of-pixels-in-0-255/m-p/435545#M68472</link>
      <description>&lt;P&gt;Just guessing here, but maybe it would be enough to just multiply by 255?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This link could also give ideas (and has additional links) &lt;A href="https://community.jmp.com/t5/Discussions/What-do-the-numbers-returned-by-lt-lt-Get-Pixels-correspond-to/m-p/252952#M49653" target="_blank" rel="noopener"&gt;What do the numbers returned by &amp;lt;&amp;lt; Get Pixels(); correspond to?&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 15:26:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-get-values-of-pixels-in-0-255/m-p/435545#M68472</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-11-11T15:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: JSL- get values of pixels in 0-255</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-get-values-of-pixels-in-0-255/m-p/435553#M68474</link>
      <description>&lt;P&gt;I think there's more than one way to do this. But here's a reference and a JMP implementation:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

Web("https://web.stanford.edu/class/cs101/image-6-grayscale.html", JMP Window);

img = Open( "$SAMPLE_IMAGES/tile.jpg", jpg );
win = New Window( "tile(40,40)", img );
{r, g, b} = img &amp;lt;&amp;lt; Get Pixels( "rgb" );

// Average the rgb values of each pixel and scale from [0, 1] to [0, 255]
nr = NRow(r);
nc = NCol(r);
r2 = Shape(r, 1, nr*nc);
g2 = Shape(g, 1, nr*nc);
b2 = Shape(b, 1, nr*nc);
g2 = VMean(VConcat(r2, g2, b2));
g = Shape(g2, nr, nc);
g = Round(g*255, 0);
dt = AsTable(g);
dt &amp;lt;&amp;lt; setName("Greyscale");&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Nov 2021 15:44:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-get-values-of-pixels-in-0-255/m-p/435553#M68474</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2021-11-11T15:44:43Z</dc:date>
    </item>
  </channel>
</rss>

