ID:               35808
 Updated by:       [EMAIL PROTECTED]
 Reported By:      pm5884 at email dot si
-Status:           Open
+Status:           Bogus
 Bug Type:         GD related
 Operating System: WinXP
 PHP Version:      4.4.1
-Assigned To:      
+Assigned To:      pajoye
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Disable antialiasing if you want only 2 colors (bgd+fgd):
ImageTtfText($image ,50 ,0 ,23 ,23 , -$text_color, $ttf_font, $text);






Previous Comments:
------------------------------------------------------------------------

[2005-12-26 17:55:05] pm5884 at email dot si

Description:
------------
A interesting problem with imagettftest function, it can't output 2
color (black & white - 1 BitsPerPixel) images. It always switches to at
least 16 color's (4 BitsPerPixel). I need 2 color output, how can I get
it???


Reproduce code:
---------------
<?
$image = ImageCreate(100,30);
$background_color = ImageColorAllocate($image, 255, 255, 255);
$text_color = ImageColorAllocate($image, 0, 0, 0);
$ttf_font = './font/Arial.ttf';
$text = 'test';
echo imagecolorstotal($image)."<br>";
ImageTtfText($image ,10 ,0 ,23 ,23 ,$text_color, $ttf_font, $text);
echo imagecolorstotal($image);
ImagePNG($image,"./file.png");
ImageDestroy($image);
?>

Expected result:
----------------
BLACK & WHITE image

Actual result:
--------------
16 clor image


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


-- 
Edit this bug report at http://bugs.php.net/?id=35808&edit=1

Reply via email to