<div dir="ltr"><div><div>Thanks for your help. Here is the resulting patch, pix2canvas. Sooner or later it will join the other abstractions in the jmmmp library.<br><br></div>Best,<br><br></div>Joao<br><div class="gmail_extra"><br><div class="gmail_quote">2016-01-01 13:10 GMT+01:00 Roman Haefeli <span dir="ltr"><<a href="mailto:reduzent@gmail.com" target="_blank">reduzent@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
On Thu, 2015-12-31 at 18:01 +0100, João Pais wrote:<br>
> If understandable, I send this patch so that it's possible to see what<br>
> I'm doing.<br>
><br>
><br>
> The idea is actually to convert a pix into a bunch of canvases, pixel<br>
> per pixel - so that a "picture" can be shown on vanilla. Follow the<br>
> instructions in the patch, and everything should be clear.<br>
> The conversion is done in [pd RGB]. There are 2 versions, but they<br>
> have the same output.<br>
<br>
</span>There are quite a few different color encodings around in Pd world. For<br>
the iemguis, there is a difference in encoding between sending a 'color'<br>
message and defining a color as creation argument. What you've done<br>
works well for sending 'color' messages to canvas, but not as a creation<br>
argument. If you want to define a color as creation argument, you have<br>
to encode it differently, namely as 6bit-per-channel value. So, instead<br>
of multiplying by 255 and powers of 256, you need to multiply by 63 and<br>
powers of 64. See attached patch.<br>
<br>
I guess the reason is a limitation in how Pd displays (and saves)<br>
numbers. Although 32-bit float numbers can fully represent 24bit integer<br>
numbers, numbers are saved with less precision in pd files (and text<br>
files), since they are truncated to 6 digits. This limitation is<br>
worked-around by reducing the resolution to 6 bits per channel. The<br>
highest number (the one representing white) is -262144. It does not<br>
exceed 6 digits and can be stored at full precision.<br>
<span class="HOEnZb"><font color="#888888"><br>
Roman<br>
</font></span><br>_______________________________________________<br>
<a href="mailto:Pd-list@lists.iem.at">Pd-list@lists.iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -> <a href="http://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br></blockquote></div></div></div>