[PD] [pix_data] - convert rgb values to pd canvas format

Jonathan Wilkes jancsika at yahoo.com
Thu Dec 31 17:42:45 CET 2015


You're making a jump from "iemgui has a lossy color representation" to "Pd's float precision is a problem".
Both may be true, but they aren't related. Pd has symbols, which are capable of losslessly storing rgb color values in any of the standard forms you see on the web (#abc, #abcdef, blue, etc.).  Additionally, Pd messages are capable of losslessly storing rgb color values (as well as just about any other color format).[foreground 80 160 240( is a valid Pd message, as is [background 1 2 3( or [fill 42 42 42(.
Also, notice that the lossy, human-unreadable iemgui color representation isn't a standard format, and that this thread is six levels deep.  Those two facts are definitely related.
-Jonathan 

    On Thursday, December 31, 2015 10:55 AM, William Huston <williamahuston at gmail.com> wrote:
 

 Well if there are 4x 8 bit values (RGB+alpha) =32 bits trying to be encoded/decoded into a single precision float, there will be loss of fidelity. 

It amazes me that it works for encoding 24 bit values (I tested it for RGB only and can send a demo patch, or check the one Katja posted here: http://lists.puredata.info/pipermail/pd-list/2015-12/112694.html )

Check out Katja's page and video about "Pd Double" for the best explanation of this problem. 

I personally wish there was a 32 bit integer data type in Pd for counters and binary registers and such, which I know will never get converted into floats, and risk strange rounding errors or noise in the Least Significant Bits. 


On Thursday, December 31, 2015, João Pais <jmmmpais at gmail.com> wrote:
> Ok. Do you know what should be done to convert to Pd's rgb format?
>
>> I'm pretty sure the 4th value is alpha
>>
>> Sent from my iPhone
>>
>>> On Dec 31, 2015, at 7:53 AM, João Pais <jmmmpais at gmail.com> wrote:
>>>
>>> Hello list,
>>>
>>> I'm trying to use [pix_data] to get the RGB values from an image, and color a canvas using them. But the results come out a bit weird, as not all colors match.
>>>
>>> I can try to some a more detailed patch in a couple of days, but wanted to ask first the there is any example of how to use the values coming out of [pix_data]:
>>> - should the gray value be used?
>>> - the middle outlet should send a list of RGB values, but I noticed that instead a list of 4 values comes out. This isn't documented, what is the 4th value?
>>>
>>> Attached are 2 pictures that should exemplifiy the issue:
>>> - rgb.tif - a rgb palette
>>> - rgb-conv.tif - the result after my interpretation of the data
>>>
>>> Best,
>>>
>>> Joao
>>> <rgb.tif>
>>> <rgb-conv.tif>
>>> _______________________________________________
>>> Pd-list at lists.iem.at mailing list
>>> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
>
> _______________________________________________
> Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
>

-- 
--
May you, and all beings
be happy and free from suffering :)
-- ancient Buddhist Prayer (Metta)


_______________________________________________
Pd-list at lists.iem.at mailing list
UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list


  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20151231/06159ebd/attachment.html>


More information about the Pd-list mailing list