[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Writing an image format
- From: Matthew Wild <mwild1@...>
- Date: Wed, 27 Oct 2010 14:18:30 +0100
On 26 October 2010 23:26, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
>> I am looking for a simple way to generate and write a color image to disk.
>
> The simplest format is the Netpbm family of formats:
> http://en.wikipedia.org/wiki/Netpbm_format
>
> Easy to generate from Lua. Here's a Lua program for generating a gray-scale
> picture of the Mandelbrot set (Mandelbrot died earlier this month).
Fun. Mostly as an academic excercise I ported your code to use my
lua-xpm library[1]. I was surprised to find that it took slightly less
time to produce the output (I guess due to less i/o), but the output
file size is about half (XPM is palette-based).
And on the assumption you don't mind, I've adopted that code for a
demo in the lua-xpm repository:
http://code.matthewwild.co.uk/lua-xpm/file/fa4d448b07d3/test_mandelbrot.lua
:)
Thanks,
Matthew
[1]: http://code.matthewwild.co.uk/lua-xpm