[squeak-dev] 16 bit GIFs (was: A nitpick)

Yoshiki Ohshima Yoshiki.Ohshima at acm.org
Sun May 11 14:31:52 UTC 2014


Thank you, Nicholas!

On Sat, May 10, 2014 at 6:46 AM, Nicolas Cellier
<nicolas.cellier.aka.nice at gmail.com> wrote:
> After further fixes i tested these forms successfully:
>
>
> #(
> pal_bk pal rgba8_bk rgba8 rgba16_bk rgba16
> rgb8_t_bk rgb8_t rgb16_t_bk rgb16_t
> gray8a_bk gray8a gray16a_bk gray16a
> gray8b_bk gray8b gray16b_bk gray16b
> pal_bk_notrns palb
> )
>  do: [:e |
> (ImageReadWriter formFromStream:
> ('http://entropymine.com/jason/testbed/pngtrans/',e,'.png') asUrl
> retrieveContents contentStream) asMorph openInWorld].
>
>
>
> 2014-05-10 12:36 GMT+02:00 Nicolas Cellier
> <nicolas.cellier.aka.nice at gmail.com>:
>
>> I just committed a fix.
>>
>> The PNGReadWriter currenlty has a hack to support 16 bits per channel gray
>> scale (with a slow bit poker loop), but not with transparency...
>> - transparency is handled with a palette
>> - ColorForm only supports depth <= 8
>> Since the Form is forced to depth 8, and since we must choose an entry in
>> the palette for transparency,  I forced the transparency to be stored at 1st
>> palette entry (value 0) in case of 16 bitsPerChannel.
>>
>> It seems to me that there was another bug even for bitsPerPixel <= 8: the
>> palette is 1-based indexed so transparent color index was one off.
>>
>> It also seems to me that the inversion 255-pixelValue is wrong in the 16
>> bitsPerChannel bitPoker loop , I did change it.
>>
>>
>> 2014-05-09 19:36 GMT+02:00 Yoshiki Ohshima <Yoshiki.Ohshima at acm.org>:
>>
>>> On Fri, May 9, 2014 at 1:14 AM, Bert Freudenberg <bert at freudenbergs.de>
>>> wrote:
>>> > Do we support any 16 bit-per-channel gifs?
>>>
>>> Not sure what you mean by "gifs" (I am specifically talking about
>>> PNGs), but sure, I think Squeak should be able to read a PNG file, as
>>> long as it is a valid one.  If it is 16 bits per channel, it should
>>> downscale the depth to 8 and create a 32 bpp Forms.  This does happen
>>> in most of the cases, but when the PNG file specifies the transparent
>>> pixel (it is also in 16 bit value), it causes an error.
>>> --
>>> -- Yoshiki
>>>
>>
>
>
>
>



-- 
-- Yoshiki


More information about the Squeak-dev mailing list