[plt-scheme] When saving a bitmap% to a PNG file, how do you specify the bit depth?

From: Grant Rettke (grettke at acm.org)
Date: Thu Jan 29 22:52:00 EST 2009

Hi Matthew,

On Wed, Jan 28, 2009 at 10:29 AM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> At Tue, 27 Jan 2009 22:33:31 -0600, Grant Rettke wrote:
>> When saving a bitmap% to a PNG file, how do you specify the bit depth?
>>
>> I need to save an image as an 8-bit PNG.
>
> There's currently no way to specify the depth or type. The output for
> color is always RGB[A] with 8 bits per channel. You need palette-based,
> 8 bits per pixel, right?

Short answer: Yes

Long answer: My friend needed some PNG's generated so I wrote it in
PLT. I wasn't familiar with PNG and he said it needs to be "8 bit".
Now that I have read up on it, I see what you mean; there is one byte
for red green and blue, and one byte for transparency. Thanks for
answering.


Posted on the users mailing list.