RE: [PHP] Image color quality problems

2001-07-21 Thread Seb Frost

Not an answer I'm afraid but does PHP has the ability to do this with JPEGs?
Would be VERY useful to me if it does!

- seb

-Original Message-
From: Kurt Lieber [mailto:[EMAIL PROTECTED]]
Sent: 21 July 2001 23:27
To: [EMAIL PROTECTED]
Subject: [PHP] Image color quality problems


I have the following code that takes an existing image, creates a new
one from it and writes some white text on top of that image:

?php
header(Content-type: image/png);

$startingImage = leftphoto_01.png;

$image = imageCreateFromPNG($startingImage);

//$white = imageColorAt($image, 30, 215);

$white = imageColorAllocate($image, 255, 255, 255);

imageTTFText($image, 24, 0, 10, 25, $white, arialbd.ttf, This is a
test);

imagePNG($image);

imagedestroy($image);
?

Problem is, the white text isn't white -- it's a dingy gray color.
From reading around, I thought maybe if I took an existing white pixel
in the image and used that to set white, that might help (hence the
commented out //$white = imageColorAt... line in my code above)  That
didn't help either.  (and the pixel I sampled is exactly the shade of
white I want)

I am almost completely unfamiliar with color pallettes and how to
manipulate them.  Can someone shed some light on how I can get some
clean, bright white text on my image?

Thanks.

--kurt


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Image color quality problems

2001-07-21 Thread Kurt Lieber

Yes, it does, through the use of the GD and freetype libraries. (the
freetype library is required for the imageTTFText function I used below)

www.php.net/imagecreatefromjpeg

 -Original Message-
 From: Seb Frost [mailto:[EMAIL PROTECTED]] 
 Sent: Saturday, July 21, 2001 3:59 PM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] Image color quality problems
 
 
 Not an answer I'm afraid but does PHP has the ability to do 
 this with JPEGs? Would be VERY useful to me if it does!
 
 - seb
 
 -Original Message-
 From: Kurt Lieber [mailto:[EMAIL PROTECTED]]
 Sent: 21 July 2001 23:27
 To: [EMAIL PROTECTED]
 Subject: [PHP] Image color quality problems
 
 
 I have the following code that takes an existing image, 
 creates a new one from it and writes some white text on top 
 of that image:
 
 ?php
 header(Content-type: image/png);
 
 $startingImage = leftphoto_01.png;
 
 $image = imageCreateFromPNG($startingImage);
 
 //$white = imageColorAt($image, 30, 215);
 
 $white = imageColorAllocate($image, 255, 255, 255);
 
 imageTTFText($image, 24, 0, 10, 25, $white, arialbd.ttf, 
 This is a test);
 
 imagePNG($image);
 
 imagedestroy($image);
 ?
 
 Problem is, the white text isn't white -- it's a dingy gray 
 color. From reading around, I thought maybe if I took an 
 existing white pixel in the image and used that to set white, 
 that might help (hence the commented out //$white = 
 imageColorAt... line in my code above)  That didn't help 
 either.  (and the pixel I sampled is exactly the shade of 
 white I want)
 
 I am almost completely unfamiliar with color pallettes and 
 how to manipulate them.  Can someone shed some light on how I 
 can get some clean, bright white text on my image?
 
 Thanks.
 
 --kurt
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: 
 [EMAIL PROTECTED] To contact the list 
 administrators, e-mail: [EMAIL PROTECTED]
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: 
 [EMAIL PROTECTED] To contact the list 
 administrators, e-mail: [EMAIL PROTECTED]
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Image color quality problems

2001-07-21 Thread Seb Frost

Thanks Kurt.  Unfortunately my server only has gd 1.6.2 (gd 1.8.3 required
aparantly) and I can't change that.  Never mind.

- seb

-Original Message-
From: Kurt Lieber [mailto:[EMAIL PROTECTED]]
Sent: 22 July 2001 00:26
To: 'Seb Frost'; [EMAIL PROTECTED]
Subject: RE: [PHP] Image color quality problems


Yes, it does, through the use of the GD and freetype libraries. (the
freetype library is required for the imageTTFText function I used below)

www.php.net/imagecreatefromjpeg

 -Original Message-
 From: Seb Frost [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, July 21, 2001 3:59 PM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] Image color quality problems


 Not an answer I'm afraid but does PHP has the ability to do
 this with JPEGs? Would be VERY useful to me if it does!

 - seb

 -Original Message-
 From: Kurt Lieber [mailto:[EMAIL PROTECTED]]
 Sent: 21 July 2001 23:27
 To: [EMAIL PROTECTED]
 Subject: [PHP] Image color quality problems


 I have the following code that takes an existing image,
 creates a new one from it and writes some white text on top
 of that image:

 ?php
 header(Content-type: image/png);

 $startingImage = leftphoto_01.png;

 $image = imageCreateFromPNG($startingImage);

 //$white = imageColorAt($image, 30, 215);

 $white = imageColorAllocate($image, 255, 255, 255);

 imageTTFText($image, 24, 0, 10, 25, $white, arialbd.ttf,
 This is a test);

 imagePNG($image);

 imagedestroy($image);
 ?

 Problem is, the white text isn't white -- it's a dingy gray
 color. From reading around, I thought maybe if I took an
 existing white pixel in the image and used that to set white,
 that might help (hence the commented out //$white =
 imageColorAt... line in my code above)  That didn't help
 either.  (and the pixel I sampled is exactly the shade of
 white I want)

 I am almost completely unfamiliar with color pallettes and
 how to manipulate them.  Can someone shed some light on how I
 can get some clean, bright white text on my image?

 Thanks.

 --kurt


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED] To contact the list
 administrators, e-mail: [EMAIL PROTECTED]



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED] To contact the list
 administrators, e-mail: [EMAIL PROTECTED]




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Image color quality problems

2001-07-21 Thread Kurt Lieber

Check out the PHP dl() function:

http://www.php.net/dl

It lets you load an extension at run-time, so if you can compile the
newer version of GD, you may be able to download that directly.  Only
thing I'm not sure about is if you can override an already-loaded
extension by downloading a newer version of the same extension.  Maybe
if you simply named it something different -- gd-1.8.3.so, for example.

Can anyone confirm whether this would work or not?

 -Original Message-
 From: Seb Frost [mailto:[EMAIL PROTECTED]] 
 Sent: Saturday, July 21, 2001 4:30 PM
 To: Kurt Lieber; [EMAIL PROTECTED]
 Subject: RE: [PHP] Image color quality problems
 
 
 Thanks Kurt.  Unfortunately my server only has gd 1.6.2 (gd 
 1.8.3 required
 aparantly) and I can't change that.  Never mind.
 
 - seb
 
 -Original Message-
 From: Kurt Lieber [mailto:[EMAIL PROTECTED]]
 Sent: 22 July 2001 00:26
 To: 'Seb Frost'; [EMAIL PROTECTED]
 Subject: RE: [PHP] Image color quality problems
 
 
 Yes, it does, through the use of the GD and freetype 
 libraries. (the freetype library is required for the 
 imageTTFText function I used below)
 
 www.php.net/imagecreatefromjpeg
 
  -Original Message-
  From: Seb Frost [mailto:[EMAIL PROTECTED]]
  Sent: Saturday, July 21, 2001 3:59 PM
  To: [EMAIL PROTECTED]
  Subject: RE: [PHP] Image color quality problems
 
 
  Not an answer I'm afraid but does PHP has the ability to do 
 this with 
  JPEGs? Would be VERY useful to me if it does!
 
  - seb
 
  -Original Message-
  From: Kurt Lieber [mailto:[EMAIL PROTECTED]]
  Sent: 21 July 2001 23:27
  To: [EMAIL PROTECTED]
  Subject: [PHP] Image color quality problems
 
 
  I have the following code that takes an existing image, 
 creates a new 
  one from it and writes some white text on top of that image:
 
  ?php
  header(Content-type: image/png);
 
  $startingImage = leftphoto_01.png;
 
  $image = imageCreateFromPNG($startingImage);
 
  //$white = imageColorAt($image, 30, 215);
 
  $white = imageColorAllocate($image, 255, 255, 255);
 
  imageTTFText($image, 24, 0, 10, 25, $white, arialbd.ttf, 
 This is a 
  test);
 
  imagePNG($image);
 
  imagedestroy($image);
  ?
 
  Problem is, the white text isn't white -- it's a dingy 
 gray color. 
  From reading around, I thought maybe if I took an existing 
 white pixel 
  in the image and used that to set white, that might help (hence the 
  commented out //$white = imageColorAt... line in my code 
 above)  That 
  didn't help either.  (and the pixel I sampled is exactly 
 the shade of
  white I want)
 
  I am almost completely unfamiliar with color pallettes and how to 
  manipulate them.  Can someone shed some light on how I can get some 
  clean, bright white text on my image?
 
  Thanks.
 
  --kurt
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED] To 
  contact the list administrators, e-mail: 
 [EMAIL PROTECTED]
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED] To 
  contact the list administrators, e-mail: 
 [EMAIL PROTECTED]
 
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: 
 [EMAIL PROTECTED] To contact the list 
 administrators, e-mail: [EMAIL PROTECTED]
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: 
 [EMAIL PROTECTED] To contact the list 
 administrators, e-mail: [EMAIL PROTECTED]
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]