Re: Image Generation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hence me saying "in the way you are asking" I know GD can scale images (I've done that myself on more than one occassion), but not images that are intended for print as opposed to screen viewing, as this appears to be.

As for quality, I've found that GD offers comparable quality images to ImageMagik, and in better time more often than not. The main advantage ImageMagik has is with functionality; quite simply, it can do much more than GD and GD2.

Ash
www.ashleysheridan.co.uk
--- Begin Message ---
Ashley Sheridan schreef:
I don't think GD has a built-in function to scale an image the way you are asking,

of course you can scale images with GD, but everything works in pixels,
ImageMagick is no different ... there is no such thing as millimeters when it
comes to bitmap images, you can specify an output resolution when printing but
that has no direct bearing on the image file itself.

Alex will have to figure out the bounding box ratios of the dimensions given in
mm and transpose that into the 300x150 pixel image he's going to use as a canvas,
the math is not that hard (can't be if I can manage it!) and although it won't
be a perfect at all times he did mention it's a representation.

If Alex requires pixel perfect representation of print output in a file then he
is going to have to resort to some kind of vector based image representation
(e.g. Adobe Illustrator) but scripting that with php is possibly going to be very
tricky, either using a COM object or shelling out to something like AppleScript
(which I know you can use to do some really crazy Illustrator scripting with)

and to do it on a pixel by pixel basis from within a function is going to be a very time consuming and memory costly process. Have you thought about using ImageMagik to do this? I know that you can exec() out to this from within Windows and Linux, and ImageMagik is free to use (as far as I'm aware) so it could be just what you need.

Ash
www.ashleysheridan.co.uk


------------------------------------------------------------------------

Onderwerp:
[PHP] Image Generation
Van:
"Alex Chamberlain" <php@xxxxxxxxxxxxxxxxxxxxx>
Datum:
Wed, 20 Aug 2008 08:29:50 +0100
Aan:
"PHP General list" <php-general@xxxxxxxxxxxxx>

Aan:
"PHP General list" <php-general@xxxxxxxxxxxxx>

Return-path:
<php-general-return-278373-ash=ashleysheridan.co.uk@xxxxxxxxxxxxx>
Envelope-to:
ash@xxxxxxxxxxxxxxxxxxxx
Delivery-date:
Wed, 20 Aug 2008 08:30:52 +0100
Received:
from [216.92.131.4] (port=26599 helo=lists.php.net) by zencphosting11.zen.co.uk with esmtp (Exim 4.68) (envelope-from <php-general-return-278373-ash=ashleysheridan.co.uk@xxxxxxxxxxxxx>) id 1KVi9b-0007aA-Qe for ash@xxxxxxxxxxxxxxxxxxxx; Wed, 20 Aug 2008 08:30:51 +0100
X-Host-Fingerprint:
216.92.131.4 lists.php.net
Received:
from [216.92.131.4] ([216.92.131.4:26502] helo=lists.php.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B7/47-51571-A28CBA84 for <ash@xxxxxxxxxxxxxxxxxxxx>; Wed, 20 Aug 2008 03:30:50 -0400
Received:
(qmail 5047 invoked by uid 1010); 20 Aug 2008 07:30:37 -0000
Mailing-List:
contact php-general-help@xxxxxxxxxxxxx; run by ezmlm
Precedence:
bulk
list-help:
<mailto:php-general-help@xxxxxxxxxxxxx>
list-unsubscribe:
<mailto:php-general-unsubscribe@xxxxxxxxxxxxx>
list-post:
<mailto:php-general@xxxxxxxxxxxxx>
Delivered-To:
mailing list php-general@xxxxxxxxxxxxx
Received:
(qmail 5040 invoked from network); 20 Aug 2008 07:30:37 -0000
Authentication-Results:
pb1.pair.com smtp.mail=php@xxxxxxxxxxxxxxxxxxxxx; spf=permerror; sender-id=unknown
Authentication-Results:
pb1.pair.com header.from=php@xxxxxxxxxxxxxxxxxxxxx; sender-id=unknown
Received-SPF:
error (pb1.pair.com: domain alexchamberlain.co.uk from 79.170.40.18 cause and error)
X-PHP-List-Original-Sender:
php@xxxxxxxxxxxxxxxxxxxxx
X-Host-Fingerprint:
79.170.40.18 mail18.extendcp.co.uk Linux 2.5 (sometimes 2.4) (4)
Bericht-ID:
<000001c90296$884ae750$98e0b5f0$@co.uk>
MIME-versie:
1.0
Content-Type:
text/plain; charset="windows-1250"
X-Mailer:
Microsoft Office Outlook 12.0
Thread-Index:
AckCloefPR8PGF4zQNGV6eViXsKrxQ==
Content-Language:
en-gb
Content-Transfer-Encoding:
base64


Hi,

I need to generate an online proof for vinyl lettering. Customers specify
the text, font, colour, maximum frame size (mm) (ie the width and height it
must fit into), and whether or not they want to keep aspect ratio (ie not
distort the lettering).

I want to represent all this on a single image. So it would display a border
with their width and height on, and inside this would be the text in the
appropriate colour and font – if they decide to keep aspect ratio the text
would not be distorted. If they do not, it would be. The image would always
be 300px wide by 150px high (these would need to be constants that I could
change from time to time).

I’ve got a very basic proof working using a GD wrapper, but I don’t think GD
is powerful enough to do it all, nor do I recon my programming skills are up
for it. Has anybody got any advice on how to tackle this, even if it is just
bits of the problem??

Thanks,

Alex Chamberlain



No virus found in this outgoing message. Scanned by AVG Free 8.0
Checked by AVG - http://www.avg.com Version: 8.0.138 / Virus Database: 270.6.6/1621 - Release Date: 19/08/2008
18:53





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux