Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

tonyc (123)

Journal of tonyc (123)

Friday August 03, 2001
10:17 AM

Imager TODO

[ #590 ]

While I'm at it, what I want to try to get done before a 0.39pre1 "release":

  • integrate the exp_represent branch into the mainline
  • fix the freetype2 problems
  • give Imager::Color->new() a keyword based interface to match all the other constructors (but still retain compatibility with the old interface)
  • implement the spatial resolution tags for other image formats
  • update the TODO list

These might not match exactly what Addi wants, but I think the first two are pretty close.

09:59 AM

Freetype 2

[ #588 ]

Back near the beginning of last month I added some support for rendering text using the Freetype2 library, including support for rotation and other transformations. Since Freetype2 supports Type1, TrueType and several other font types, once you have this you don't really need the other font libraries, at least that's the idea.

Unfortunately my original implementation was a bit too simple - when writing to a channel the bitmap for one glyph could overwrite the previous glyph, especially for rotated text.

I've been a little busy over the last few weeks, so I haven't been able to get much done on fixing this, though I made the first steps today.

I did manage to add some simple tags to support getting and setting the spatial resolution of an image. This is currently only used for PNG files, but will eventually be implemented for other image types. I want to fix the Freetype 2 problems first .

Wednesday July 04, 2001
12:34 AM

Win32 fonts

[ #371 ]

Until now Imager didn't have any font support on Win32 systems. That's changed.

Both the usual Imager t1lib and freetype1 support now work, using both MSVC++ and cygwin.

With current CVS versions (with -r exp_represent) of Imager you can also use Win32's native GDI font support. So you can use any of those 1000 fonts you have installed :) This works under cygwin too, assuming you have the w32api package installed.

Saturday June 30, 2001
11:42 PM

more rotation

[ #363 ]

Imager finally has exact image rotation with interpolation:

  1. my $rimg = $img->rotate(degrees=>$amount)

Under the hood this uses matrices to tranform the co-ordinates, so we should be able to add other transformations such as shearing fairly easily, and possibly even some perspective effects.

10:14 AM

filters and fonts

[ #361 ]

I finally finished documenting Imager's built-in filters, and created a simple page demonstrating the results. I also added gaussian blur as a filter, the code was there, and it was accessible as a non-OO function, but the aim is to have everything available in the OO interface.

I found a in the bounding box handler while I was creating a basic logo generator -- it was chopping off the right-side of italic fonts. I finally got around to fixing it.

It's now June 1, time to thing about taxes <sigh>.

Tuesday June 26, 2001
10:15 PM


[ #339 ]

Imager can finally rotate images, even if it's only by steps of 90 degrees.

07:36 AM

reading animated GIFs

[ #336 ]

I finally got it all going, but it's been a slow weekend.

Now Imager can read images from a GIF file as separate images, with the palette for each image, since Imager now has indexed images. The new read_multi() function sets tags on each image, including transparency and animation information.

  • my @imgs = Imager->read_multi(file=>$filename);
    for my $img (@imgs) {
      my $delay;
      print "Delay $delay\n"
        if defined($delay = $img->tags(name=>'gif_delay'));

Now I just need to find the tuits to make the writegif_gen() code understand paletted images.

Friday June 22, 2001
01:59 AM

reading GIFs

[ #327 ]

Imager's GIF reading code currently loads everything into one image overlaying sub images over another.

Now that Imager has paletted images (as well as RGB), we can load each image from the GIF file into it's own image, preserving the palette. Well, once I add code to do that.

Hopefully this will let us use that palette on save, eliminating the lengthy process of finding the (almost) optimum palette.

Of course, I'll probably find a few more giflib bugs along the way.

12:20 AM


[ #326 ]

After a bit of paid work, I went back to Imager, adding some tests for Imager::Transform, which I forgot to provide tests for when I wrote it - oops.

Imager::Transform provides an interface to a few different transform2() operations, including mandelbrot set generation and adding ripples to an image.