Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ANNOUNCE: tcl.gd interface to GD graphics drawing library, version 1.1

55 views
Skip to first unread message

Karl Lehenbauer

unread,
Jan 19, 2011, 2:24:28 PM1/19/11
to
I am pleased to announce the release of tcl.gd version 1.1, a modern Tcl interface to the GD drawing library that is nearly 100% feature complete with GD, far more complete with gd 2 than Gdtclft.

After package requiring the tclgd package, you use the GD command with a suboption to create an image object. You can create an indexed or truecolor image, either starting with an empty one or loading one from a JPEG, PNG, GIF, WBMP, XBM, XPM, GD or GD2 native formats, depending on build options.

This create a new command object that you use to manipulate and save your image. You can draw pixels, lines, polygons, rectangles, arcs, and ellipses. You can emit text styled with truetype fonts. You can fill, manage colors, anti-alias, resize, resample, rotate, and merge images, and you can save images as JPEG, GIF, animated GIF, PNG8, PNG24, etc.

The source tarball can be downloaded from https://github.com/downloads/lehenbauer/tcl.gd/tcl.gd-1.1.tar.gz or the repository can be cloned with "git clone git://github.com/lehenbauer/tcl.gd.git"

The tcl.gd webpage can be viewed at: http://lehenbauer.github.com/tcl.gd/
The github project for tcl.gd is at https://github.com/lehenbauer/tcl.gd

Thanks, and enjoy tcl.gd.

Karl Lehenbauer
FlightAware

Harald Oehlmann

unread,
Jan 20, 2011, 3:37:13 AM1/20/11
to
Thank you Karl, this is great news !
Harald

Arjen Markus

unread,
Jan 20, 2011, 4:26:18 AM1/20/11
to
On 19 jan, 20:24, Karl Lehenbauer <karllehenba...@gmail.com> wrote:
> I am pleased to announce the release of tcl.gd version 1.1, a modern Tcl interface to the GD drawing library that is nearly 100% feature complete with GD, far more complete with gd 2 than Gdtclft.
>
> After package requiring the tclgd package, you use the GD command with a suboption to create an image object. You can create an indexed or truecolor image, either starting with an empty one or loading one from a JPEG, PNG, GIF, WBMP, XBM, XPM, GD or GD2 native formats, depending on build options.
>
> This create a new command object that you use to manipulate and save your image. You can draw pixels, lines, polygons, rectangles, arcs, and ellipses. You can emit text styled with truetype fonts. You can fill, manage colors, anti-alias, resize, resample, rotate, and merge images, and you can save images as JPEG, GIF, animated GIF, PNG8, PNG24, etc.
>
> The source tarball can be downloaded fromhttps://github.com/downloads/lehenbauer/tcl.gd/tcl.gd-1.1.tar.gzor the repository can be cloned with "git clone git://github.com/lehenbauer/tcl.gd.git"

>
> The tcl.gd webpage can be viewed at:http://lehenbauer.github.com/tcl.gd/
> The github project for tcl.gd is athttps://github.com/lehenbauer/tcl.gd

>
> Thanks, and enjoy tcl.gd.
>
> Karl Lehenbauer
> FlightAware

Is it also possible to "dump" a regular canvas widget into a JPEG or
whatever file?
(Of course I can use the Img package for at least a few of these
formats, but that
is basically a screendump.) Or maybe use the canvas widget's commands
and instead
of drawing on an actual window, you draw in a JPEG file.

Merely thinking out loud: such facilities would make it possible to
use existing
code to create JPEG files in, say, a web server application ... No
need for an
actual display.

Regards,

Arjen

Andreas Kupries

unread,
Jan 25, 2011, 1:42:54 AM1/25/11
to
Arjen Markus <arjen.m...@gmail.com> writes:

> On 19 jan, 20:24, Karl Lehenbauer <karllehenba...@gmail.com> wrote:
>> I am pleased to announce the release of tcl.gd version 1.1, a modern Tcl interface to the GD drawing library that is nearly 100% feature complete with GD, far more complete with gd 2 than Gdtclft.
>>
>> After package requiring the tclgd package, you use the GD command with a suboption to create an image object. You can create an indexed or truecolor image, either starting with an empty one or loading one from a JPEG, PNG, GIF, WBMP, XBM, XPM, GD or GD2 native formats, depending on build options.
>>
>> This create a new command object that you use to manipulate and save your image. You can draw pixels, lines, polygons, rectangles, arcs, and ellipses. You can emit text styled with truetype fonts. You can fill, manage colors, anti-alias, resize, resample, rotate, and merge images, and you can save images as JPEG, GIF, animated GIF, PNG8, PNG24, etc.
>>
>> The source tarball can be downloaded fromhttps://github.com/downloads/lehenbauer/tcl.gd/tcl.gd-1.1.tar.gzor the repository can be cloned with "git clone git://github.com/lehenbauer/tcl.gd.git"
>>
>> The tcl.gd webpage can be viewed at:http://lehenbauer.github.com/tcl.gd/
>> The github project for tcl.gd is athttps://github.com/lehenbauer/tcl.gd
>>
>> Thanks, and enjoy tcl.gd.
>>
>> Karl Lehenbauer
>> FlightAware
>
> Is it also possible to "dump" a regular canvas widget into a JPEG or
> whatever file?
> (Of course I can use the Img package for at least a few of these
> formats, but that
> is basically a screendump.) Or maybe use the canvas widget's commands
> and instead
> of drawing on an actual window, you draw in a JPEG file.

Note
canvas::snap in Tklib

http://docs.activestate.com/activetcl/8.5/tklib/canvas/canvas_snap.html
http://docs.activestate.com/activetcl/8.5/tklib/canvas/canvas_mvg.html

The wiki should also have code for dumping a canvas to SVG format.

> Merely thinking out loud: such facilities would make it possible to
> use existing
> code to create JPEG files in, say, a web server application ... No
> need for an
> actual display.
>
> Regards,
>
> Arjen

--
So long,
Andreas Kupries <akup...@shaw.ca>
<http://www.purl.org/NET/akupries/>
Developer @ <http://www.activestate.com/>
-------------------------------------------------------------------------------

AurovilleRadio

unread,
Jan 25, 2011, 3:59:30 AM1/25/11
to
On Jan 25, 11:42 am, Andreas Kupries <akupr...@shaw.ca> wrote:

> Arjen Markus <arjen.markus...@gmail.com> writes:
> > On 19 jan, 20:24, Karl Lehenbauer <karllehenba...@gmail.com> wrote:
> >> I am pleased to announce the release of tcl.gd version 1.1, a modern Tcl interface to the GD drawing library that is nearly 100% feature complete with GD, far more complete with gd 2 than Gdtclft.
>
> >> After package requiring the tclgd package, you use the GD command with a suboption to create an image object. You can create an indexed or truecolor image, either starting with an empty one or loading one from a JPEG, PNG, GIF, WBMP, XBM, XPM, GD or GD2 native formats, depending on build options.
>
> >> This create a new command object that you use to manipulate and save your image. You can draw pixels, lines, polygons, rectangles, arcs, and ellipses. You can emit text styled with truetype fonts. You can fill, manage colors, anti-alias, resize, resample, rotate, and merge images, and you can save images as JPEG, GIF, animated GIF, PNG8, PNG24, etc.
>
> >> The source tarball can be downloaded fromhttps://github.com/downloads/lehenbauer/tcl.gd/tcl.gd-1.1.tar.gzorthe repository can be cloned with "git clone git://github.com/lehenbauer/tcl.gd.git"

>
> >> The tcl.gd webpage can be viewed at:http://lehenbauer.github.com/tcl.gd/
> >> The github project for tcl.gd is athttps://github.com/lehenbauer/tcl.gd
>
> >> Thanks, and enjoy tcl.gd.
>
> >> Karl Lehenbauer
> >> FlightAware
>
> > Is it also possible to "dump" a regular canvas widget into a JPEG or
> > whatever file?
> > (Of course I can use the Img package for at least a few of these
> > formats, but that
> > is basically a screendump.) Or maybe use the canvas widget's commands
> > and instead
> > of drawing on an actual window, you draw in a JPEG file.
>
> Note
>         canvas::snap in Tklib
>
> http://docs.activestate.com/activetcl/8.5/tklib/canvas/canvas_snap.htmlhttp://docs.activestate.com/activetcl/8.5/tklib/canvas/canvas_mvg.html

>
> The wiki should also have code for dumping a canvas to SVG format.
>
> > Merely thinking out loud: such facilities would make it possible to
> > use existing
> > code to create JPEG files in, say, a web server application ... No
> > need for an
> > actual display.
>
> > Regards,
>
> > Arjen
>
> --
> So long,
>         Andreas Kupries <akupr...@shaw.ca>

>                         <http://www.purl.org/NET/akupries/>
>         Developer @     <http://www.activestate.com/>
> -------------------------------------------------------------------------------

but if canvas::snap required Tk which means that it requires a display
and this is not good for web server environment. For example We use
TGDChart (tcl package for http://www.fred.net/brv/chart/) to create
graphs and it works with no Tk which is great. Shame it is a bit dead
project now...

Andreas Kupries

unread,
Jan 25, 2011, 10:32:05 AM1/25/11
to
AurovilleRadio <avrad...@gmail.com> writes:

>> Note
>>         canvas::snap in Tklib
>>
>> http://docs.activestate.com/activetcl/8.5/tklib/canvas/canvas_snap.htmlhttp://docs.activestate.com/activetcl/8.5/tklib/canvas/canvas_mvg.html
>>
>> The wiki should also have code for dumping a canvas to SVG format.

> but if canvas::snap required Tk

It does.

> which means that it requires a display
> and this is not good for web server environment.

Point.

> For example We use
> TGDChart (tcl package for http://www.fred.net/brv/chart/) to create
> graphs and it works with no Tk which is great. Shame it is a bit dead
> project now...

--
So long,
Andreas Kupries <akup...@shaw.ca>

Karl Lehenbauer

unread,
Jan 25, 2011, 11:04:50 PM1/25/11
to
On Tuesday, January 25, 2011 2:59:30 AM UTC-6, AurovilleRadio wrote:
> but if canvas::snap required Tk which means that it requires a display
> and this is not good for web server environment.

tcl.gd does not require any X-Windows but its APIs are tailored toward GD. Even the coordinate system is different from Tk's.

It is possible to use Xvfb to run X-Windows programs headless. ImageMagick's "import" command can be used to grab images from the frame buffer, by window, screen or area. You can run multiple instances of Xvfb and control which one programs draw to as well.

0 new messages