Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:18761 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63015 invoked by uid 1010); 10 Sep 2005 15:29:43 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 63000 invoked from network); 10 Sep 2005 15:29:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Sep 2005 15:29:43 -0000 X-Host-Fingerprint: 64.233.184.196 wproxy.gmail.com Linux 2.4/2.6 Received: from ([64.233.184.196:22424] helo=wproxy.gmail.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 2F/99-17383-5EBF2234 for ; Sat, 10 Sep 2005 11:29:41 -0400 Received: by wproxy.gmail.com with SMTP id 36so1962607wra for ; Sat, 10 Sep 2005 08:29:38 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=dQpsHBiokQxbGBF5dYgn1JP7B8hmggtRtQYscEIjigsT6sSyLUhJTttnGhas5Y4KfGm+XrubWquij0CK9VsughBIVnksM6CJ7XFOqjOp75dSAwxFdMi0eucmS/UvKe5xEUIePhFQ3tUp7vE7aj8/HkZ6dIsdkwwpeuxld76qOOo= Received: by 10.54.2.56 with SMTP id 56mr1240639wrb; Sat, 10 Sep 2005 08:29:37 -0700 (PDT) Received: by 10.54.154.16 with HTTP; Sat, 10 Sep 2005 08:29:36 -0700 (PDT) Message-ID: Date: Sat, 10 Sep 2005 17:29:37 +0200 Reply-To: pierre.php@gmail.com To: internals@lists.php.net In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <432271EE.7030509@es.co.nz> Subject: re: ImageAntialias From: pierre.php@gmail.com (Pierre Joye) Hello, > Not sure if this is best suited for the devel list or the user list, but > here goes.: > > Antialiasing is a basic requirement for generating professional-quality > pictures. Unfortunately the php-gd function imageantialias needs work. > Only a small subset of drawing primitives currently make use of > antialiasing. Yes, only a small set, the lines, ellipse and circles are coming. They were ready but not synced with the current GD. > See http://www.php.net/manual/en/function.imageantialias.php > > To quote, "This function is currently not documented; only the argument > list is available." So there is no documented expected behaviour for > imageantialias. The only hint of what it can and can't do is in a > user-contributed comment on the same page (provided by Yours Truly). > Yet at least one bug report http://bugs.php.net/bug.php?id=3D24798 has > been marked as 'bogus', although it is at worst is a reasonable feature > request if not a bug. Doc can be quicly fixed, "It works only with blending mode, no alpha channel is used." > Actually I propose a new method for antialiasing: > > bool imageantialias ( resource im, bool on, int MODE ) > > where MODE is one of: > > AA_TRADITIONAL - Perform antialiasing the same way it's done now - that > is to use a different antialiasing function for each primitive, most of > which haven't yet been implemented. It is the only possible way right now. The support for the other primitives are coming (ellipse, circle soon), the problem is a bit more complex that you may think. Having the good compromise between speed and quality is not that easy. Keeping in mind that php is a web language and not a Adobe Illustrator (c) concurrent, with all the constraints brought by the web environment (server). > AA_SCALE - Draw the image to an internal buffer at 2x the requested > size, using regular non-antialiased primitives, and downscale the result > to the requested size with bilinear filtering. This produces nice > antialiased images with very little duplication of code across > primitives. Line thickness may need to be doubled to give the right effe= ct. This is horribly slow and ugly. I'm strongly opposed to implement such thing in ext/gd. > AA_TEXT - Draw/downsample the image as above, but omit text objects > until after the image has been downsampled. This allows for clearer but > non-antialiased text. I fail to see the usage for that, can you bring some basic examples? Or are you talking about layers? Regards, --Pierre