From: William Bland
Subject: Fun with Lisp and photos
Date: 
Message-ID: <pan.2004.10.03.01.39.15.153014@abstractnonsense.com>
I've just spent the best part of a day combining my two favorite hobbies
(photography and Lisp), typing stuff like

(defun mangle (name)
  (let ((image (png:decode-file name)))
    (png:encode-file (dotimes (i (array-dimension image 0) image)
		       (dotimes (j (array-dimension image 1))
			 (setf (aref image i j)
			       (lognot (aref image i j)))))
		     (concatenate 'string "new" name))))

(and some much more baroque formulae) into SLIME and seeing what happens.

Hours of fun guaranteed ;-)

You can see one of the results here:
http://www.abstractnonsense.com/tap.jpg
http://www.abstractnonsense.com/newtap.jpg

Lisp is just *so* cool for this kind of thing.  Sure, I could have done
this stuff in pretty much any language, but without a REPL I wouldn't have
had the instant "and what happens if I pull this lever?" factor.

Just wanted to share that.
Cheers,
	Bill.
-- 
Dr. William Bland.
It would not be too unfair to any language to refer to Java as a
stripped down Lisp or Smalltalk with a C syntax.   (Ken Anderson).

From: Pascal Bourguignon
Subject: Re: Fun with Lisp and photos
Date: 
Message-ID: <878yaopm21.fsf@thalassa.informatimago.com>
William Bland <·······@abstractnonsense.com> writes:

> I've just spent the best part of a day combining my two favorite hobbies
> (photography and Lisp), typing stuff like
> 
> (defun mangle (name)
>   (let ((image (png:decode-file name)))
>     (png:encode-file (dotimes (i (array-dimension image 0) image)
> 		       (dotimes (j (array-dimension image 1))
> 			 (setf (aref image i j)
> 			       (lognot (aref image i j)))))
> 		     (concatenate 'string "new" name))))
> 
> (and some much more baroque formulae) into SLIME and seeing what happens.
> 
> Hours of fun guaranteed ;-)
> 
> You can see one of the results here:
> http://www.abstractnonsense.com/tap.jpg
> http://www.abstractnonsense.com/newtap.jpg
> 
> Lisp is just *so* cool for this kind of thing.  Sure, I could have done
> this stuff in pretty much any language, but without a REPL I wouldn't have
> had the instant "and what happens if I pull this lever?" factor.
> 
> Just wanted to share that.

Fine!  Now I can dump gimp and do my photo processing with Common-Lisp :-)

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

To vote Democrat or Republican, it's like changing of cabin in the Titanic.
From: Kenny Tilton
Subject: Re: Fun with Lisp and photos
Date: 
Message-ID: <EXJ7d.154730$4h7.26611641@twister.nyc.rr.com>
Pascal Bourguignon wrote:
> Fine!  Now I can dump gimp and do my photo processing with Common-Lisp :-)

Grab the cl-magick bindings to GraphicksMagick and you have a good 
start. Then you just need a good gui framework to create some tools, and 
voila cl-photoshop.

:)

kt

-- 
Cells? Cello? Celtik?: http://www.common-lisp.net/project/cells/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
From: William Bland
Subject: Re: Fun with Lisp and photos
Date: 
Message-ID: <pan.2004.10.03.03.23.50.628354@abstractnonsense.com>
On Sun, 03 Oct 2004 04:33:58 +0200, Pascal Bourguignon wrote:
> 
> Fine!  Now I can dump gimp and do my photo processing with Common-Lisp :-)

Well this was certainly more fun than the one time I wrote a gimp
plugin (that was a few years ago though, so it may have become easier).

Cheers,
	Bill.
-- 
Dr. William Bland.
It would not be too unfair to any language to refer to Java as a
stripped down Lisp or Smalltalk with a C syntax.   (Ken Anderson).
From: Paolo Amoroso
Subject: Re: Fun with Lisp and photos
Date: 
Message-ID: <87ekkg6rys.fsf@plato.moon.paoloamoroso.it>
William Bland <·······@abstractnonsense.com> writes:

> You can see one of the results here:
> http://www.abstractnonsense.com/tap.jpg
> http://www.abstractnonsense.com/newtap.jpg

The latter picture shows that Lisp is the Philosopher's Stone: it
turns everything into gold.


Paolo
-- 
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
Recommended Common Lisp libraries/tools (see also http://clrfi.alu.org):
- ASDF/ASDF-INSTALL: system building/installation
- CL-PPCRE: regular expressions
- UFFI: Foreign Function Interface
From: Andras Simon
Subject: Re: Fun with Lisp and photos
Date: 
Message-ID: <vcdfz4w6qgl.fsf@csusza.math.bme.hu>
William Bland <·······@abstractnonsense.com> writes:

> I've just spent the best part of a day combining my two favorite hobbies
> (photography and Lisp), typing stuff like
> 
> (defun mangle (name)
>   (let ((image (png:decode-file name)))
>     (png:encode-file (dotimes (i (array-dimension image 0) image)
> 		       (dotimes (j (array-dimension image 1))
> 			 (setf (aref image i j)
> 			       (lognot (aref image i j)))))
> 		     (concatenate 'string "new" name))))
> 
> (and some much more baroque formulae) into SLIME and seeing what happens.

Cute! Where does the png package come from? 

> 
> Hours of fun guaranteed ;-)

No doubt!

Andras
From: Frank Buss
Subject: Re: Fun with Lisp and photos
Date: 
Message-ID: <cjot48$ct3$1@newsreader2.netcologne.de>
Andras Simon <······@math.bme.hu> wrote:

> Cute! Where does the png package come from? 

a search on CLiki shows a library, which could be the used one:

http://www.ljosa.com/~ljosa/software/cl-png/

-- 
Frank Bu�, ··@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
From: William Bland
Subject: Re: Fun with Lisp and photos
Date: 
Message-ID: <pan.2004.10.03.14.45.34.533441@abstractnonsense.com>
On Sun, 03 Oct 2004 12:59:52 +0000, Frank Buss wrote:

> Andras Simon <······@math.bme.hu> wrote:
> 
>> Cute! Where does the png package come from? 
> 
> a search on CLiki shows a library, which could be the used one:
> 
> http://www.ljosa.com/~ljosa/software/cl-png/

Yes, that's the one.  Now I'm using Gentoo, all I had to do was
"emerge cl-png".  One of the best things about Gentoo for me is the huge
number of Lisp packages available for it.

Cheers,
	Bill.
-- 
Dr. William Bland.
It would not be too unfair to any language to refer to Java as a
stripped down Lisp or Smalltalk with a C syntax.   (Ken Anderson).
From: Andras Simon
Subject: Re: Fun with Lisp and photos
Date: 
Message-ID: <vcd7jq77l86.fsf@csusza.math.bme.hu>
Frank Buss <··@frank-buss.de> writes:

> Andras Simon <······@math.bme.hu> wrote:
> 
> > Cute! Where does the png package come from? 
> 
> a search on CLiki shows a library, which could be the used one:
> 
> http://www.ljosa.com/~ljosa/software/cl-png/

Thanks!

Andras
From: Matthieu Villeneuve
Subject: Re: Fun with Lisp and photos
Date: 
Message-ID: <41612772$0$24945$636a15ce@news.free.fr>
"William Bland" <·······@abstractnonsense.com> wrote in message
···································@abstractnonsense.com...
> I've just spent the best part of a day combining my two favorite hobbies
> (photography and Lisp), typing stuff like
>
> (defun mangle (name)
>   (let ((image (png:decode-file name)))
>     (png:encode-file (dotimes (i (array-dimension image 0) image)
>        (dotimes (j (array-dimension image 1))
> (setf (aref image i j)
>        (lognot (aref image i j)))))
>      (concatenate 'string "new" name))))
>
> (and some much more baroque formulae) into SLIME and seeing what happens.
>
> Hours of fun guaranteed ;-)

I'm currently working on a little image manipulation library called IMAGO.
So far it handles PNG, PNM and TGA file formats, and offers a few utilities
for stuff like that (and image composition, convolution-based filters,
etc.) For example, the equivalent of the above code could be:

  (defun mangle (name)
    (let ((image (read-png name)))
      (do-image-pixels (image x y color)
        (setf color (invert-color color)))
      (write-png image (concatenate 'string "new" name))))

I'm planning on releasing a first version on common-lisp.net in a few days
(maybe a couple of weeks), but until then feel free to email me if you
want the code in its current state.


--
Matthieu Villeneuve
From: Matthieu Villeneuve
Subject: Re: Fun with Lisp and photos
Date: 
Message-ID: <416ba1eb$0$28944$636a15ce@news.free.fr>
"Matthieu Villeneuve" <·····················@freeDOTfr> wrote in message
······························@news.free.fr...
> I'm currently working on a little image manipulation library called IMAGO.
> So far it handles PNG, PNM and TGA file formats, and offers a few
utilities
> for stuff like that (and image composition, convolution-based filters,
> etc.)

Check out the following page for a few (very simple) examples:
http://matthieu.villeneuve.free.fr/dev/imago/examples.html

Regards,


--
Matthieu Villeneuve
From: William Bland
Subject: Re: Fun with Lisp and photos
Date: 
Message-ID: <pan.2004.10.12.17.20.33.625581@abstractnonsense.com>
On Tue, 12 Oct 2004 11:22:27 +0200, Matthieu Villeneuve wrote:

> "Matthieu Villeneuve" <·····················@freeDOTfr> wrote in message
> ······························@news.free.fr...
>> I'm currently working on a little image manipulation library called IMAGO.
>> So far it handles PNG, PNM and TGA file formats, and offers a few
> utilities
>> for stuff like that (and image composition, convolution-based filters,
>> etc.)
> 
> Check out the following page for a few (very simple) examples:
> http://matthieu.villeneuve.free.fr/dev/imago/examples.html
> 

Thanks, I did - it looks very cool!  I'm going to switch to using it
rather than cl-png when I get a few spare cycles (Real Soon Now).

Cheers,
	Bill.
-- 
"If you give someone Fortran, he has Fortran. If you give someone Lisp,
he has any language he pleases." -- Guy Steele