
Hi list, i am new in Haskell. I need to make images (PNG, JPEG) with haskell, if you can give me a tutorial, thanks! -- Nahuel Rullo

Nahuel Rullo wrote:
Hi list, i am new in Haskell. I need to make images (PNG, JPEG) with haskell, if you can give me a tutorial, thanks!
Gtk2hs has the ability to read and write PNG and JPEG images. Have a look at the Graphics.UI.Gtk.Gdk.Pixbuf module: http://www.haskell.org/gtk2hs/docs/gtk2hs-docs-0.9.12/Graphics-UI-Gtk-Gdk-Pi... Specifically, look at pixbufNewFromFile and pixbufSave. If you then take a look at the Graphics.UI.Gtk.Gdk.Drawable module, you'll see a bunch of functions for drawing onto a Pixbuf. (Alternatively you can use Cairo.) However, if you're trying to draw an algorithmically generated set of pixels, you'll probably want to manipulate the underlying bitmap directly. This is Not Fun. Take a look at the QuickDraw demo to see how it's done... HTH.

SDL-image (http://hackage.haskell.org/cgi-bin/hackage-scripts/package/SDL-image-0.5.2)
also supports this.
Luke
On Sun, May 4, 2008 at 12:12 AM, Nahuel Rullo
Hi list, i am new in Haskell. I need to make images (PNG, JPEG) with haskell, if you can give me a tutorial, thanks!
-- Nahuel Rullo _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Sun, 2008-05-04 at 03:12 -0300, Nahuel Rullo wrote:
Hi list, i am new in Haskell. I need to make images (PNG, JPEG) with haskell, if you can give me a tutorial, thanks! I don't know about jpeg, but for png (with Cairo) see:
http://darcs.haskell.org/gtk2hs/docs/tutorial/Tutorial_Port/app1.xhtml Regards, Hans van Thiel

It would be nice to have haskell bindings to the libpng C library. I
had trouble calling libpng functions since it uses setjmp for error
handling, and it wasn't clear that haskell could handle this. I ended
up writing a few wrapper functions in C. An alternative more ambitious
project would be a pure haskell PNG implementation.
On Sat, May 3, 2008 at 11:12 PM, Nahuel Rullo
Hi list, i am new in Haskell. I need to make images (PNG, JPEG) with haskell, if you can give me a tutorial, thanks!
-- Nahuel Rullo _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

The libgd bindings can be used to create PNG images. See
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/gd
/Björn
On Mon, May 5, 2008 at 9:05 AM, Bit Connor
It would be nice to have haskell bindings to the libpng C library. I had trouble calling libpng functions since it uses setjmp for error handling, and it wasn't clear that haskell could handle this. I ended up writing a few wrapper functions in C. An alternative more ambitious project would be a pure haskell PNG implementation.
On Sat, May 3, 2008 at 11:12 PM, Nahuel Rullo
wrote: Hi list, i am new in Haskell. I need to make images (PNG, JPEG) with haskell, if you can give me a tutorial, thanks!
-- Nahuel Rullo

As long as you don't mind producing two-color images,
http://haskell.org/haskellwiki/Library/PNG is an option. I found it
very easy to extend it to eight-bit grayscale - I didn't need
fullcolor images.
/g
On Sat, May 3, 2008 at 11:12 PM, Nahuel Rullo
Hi list, i am new in Haskell. I need to make images (PNG, JPEG) with haskell, if you can give me a tutorial, thanks!
-- Nahuel Rullo _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- It is myself I have never met, whose face is pasted on the underside of my mind.
participants (8)
-
Andrew Coppin
-
Bit Connor
-
Bjorn Bringert
-
Brent Yorgey
-
Hans van Thiel
-
J. Garrett Morris
-
Luke Palmer
-
Nahuel Rullo