[plt-scheme] Image library bug?

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Mon Dec 7 19:37:46 EST 2009

On Mon, Dec 7, 2009 at 6:32 PM, Jordan Johnson <jmj at fellowhuman.com> wrote:
> Thanks, Robby.
>
> If the color-lists will be reimplemented in 2htdp/image, I wouldn't terribly
> mind the change simply being to the old library's docs.  I see there isn't
> an equivalent of the image<->color-list functions in the new library; is
> that likely to make its way in eventually?  If not, it would be nice to have
> a way to make this work in the old version.

Yes, there will be something along these lines in 2htdp/image
eventually. But it won't be quite the same; specifically you'll only
be able to get back a bitmap not an image. (There was some discussion
of this earlier, but I don't have a link to the archives handy. Todd
started that conversation if memory serves.)

> BTW, since it's related: it has bugged me for a while that the shape
> primitives (rectangle, circle, etc.) accept color structs but not
> alpha-colors.  If there are plans to support color structs in the 2e
> version, it'd be Really Neat if both kinds could work, or if alpha-colors
> were the only kind of color struct (perhaps with a constructor like
> make-color that creates a fully-opaque color).

I'd like to add something like slideshow's cellophane operator
instead, probably. Would that work okay for you?

http://docs.plt-scheme.org/slideshow/Pict_Drawing_Adjusters.html#(def._((lib._slideshow/pict..ss)._cellophane))

Robby

> Thanks again.
>
> Best,
> Jordan
>
>
> On Dec 7, 2009, at 2:34 PM, Robby Findler <robby at eecs.northwestern.edu>
> wrote:
>
>> Somewhere along the way, apparently it was decided that white pixels
>> in color-list->image were actually transparent, not white. I'm not
>> sure why that is the case, but that's why the below are not the same.
>>
>> This is not documented, and I'm not sure if it shoudl be documented or
>> changed. I lean towards changing the documentation since htdp/image
>> has been in use for a long time, but does anyone remember or have
>> opinions one way or the other?
>>
>> Robby
>>
>> On Mon, Dec 7, 2009 at 4:20 PM, Jordan Johnson <jmj at fellowhuman.com>
>> wrote:
>>>
>>> Hi all,
>>>>
>>>
>>> The following (which I hope hasn't been too badly mangled by my iPod
>>> mailer)
>>> evaluates to false:
>>>
>>>> (image=? (color-list->image (build-list 9 (lambda (i) (make-color 255
>>>> 255
>>>> 255)))
>>>>                             3 3 1 1)
>>>>        (rectangle 3 3 "solid" (make-color 255 255 255)))
>>>
>>> Manual testing verifies that the dimensions and pinhole location are
>>> equal,
>>> as are the lists produced from these images via image->color-list.
>>>
>>> Any ideas?
>>>
>>> Best,
>>> Jordan
>>>
>>> _________________________________________________
>>>  For list-related administrative tasks:
>>>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>>>
>


Posted on the users mailing list.