Haskell PNG Writer

View: New views
8 Messages — Rating Filter:   Alert me  

Haskell PNG Writer

by Nahuel Rullo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: Haskell PNG Writer

by Andrew Coppin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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-Pixbuf.html

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.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@...
http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: Haskell PNG Writer

by Luke Palmer-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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 <nahuelrullo@...> 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
>  _______________________________________________
>  Haskell-Cafe mailing list
>  Haskell-Cafe@...
>  http://www.haskell.org/mailman/listinfo/haskell-cafe
>
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@...
http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: Haskell PNG Writer

by Hans van Thiel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@...
http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: Haskell PNG Writer

by Brent Yorgey :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Sun, May 4, 2008 at 2:12 AM, Nahuel Rullo <nahuelrullo@...> 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!

What kind of images do you need to make?

-Brent

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@...
http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: Haskell PNG Writer

by Bit Connor :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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 <nahuelrullo@...> 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
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe@...
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@...
http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: Haskell PNG Writer

by Bjorn Bringert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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 <bit@...> wrote:

> 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 <nahuelrullo@...> 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

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@...
http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: Haskell PNG Writer

by J. Garrett Morris :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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 <nahuelrullo@...> 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
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe@...
> 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.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@...
http://www.haskell.org/mailman/listinfo/haskell-cafe