php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59610 pseudo image caption wont allow transparent background
Submitted: 2011-02-07 06:38 UTC Modified: 2011-05-06 07:07 UTC
From: junkboypaul at hotmail dot com Assigned:
Status: Not a bug Package: imagick (PECL)
PHP Version: 5.2.6 OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: junkboypaul at hotmail dot com
New email:
PHP Version: OS:

 

 [2011-02-07 06:38 UTC] junkboypaul at hotmail dot com
Description:
------------
I tried generating caption text image with transparent background.

Reproduce code:
---------------
<?php
$image_width = 200;
$image_height = 200;
$text = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
		 Mauris lectus mi, mattis non, euismod vel, sagittis nec, ipsum.";
$im = new Imagick();

$im->newPseudoImage( $image_width, $image_height, "caption:" . $text );
$im->setImageVirtualPixelMethod(Imagick::VIRTUALPIXELMETHOD_TRANSPARENT);
$im->setImageMatte(true);
$im->borderImage( 'black', 1, 1 );
$im->colorizeImage('#FF0000',0.3);
$im->setImageFormat( "png") ;
header( "Content-Type: image/png" );
echo $im;


Expected result:
----------------
Transparent background with red text and red border

Actual result:
--------------
solid white background with red text and red border

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-02-07 06:46 UTC] mkoppanen@php.net
Try calling:

$im->setBackgroundColor("transparent");

before the newPseudoImage call. Does it help?
 [2011-02-07 08:29 UTC] junkboypaul at hotmail dot com
Now it's showing a solid red background. I need it to have a transparent background with red text.
 [2011-05-06 07:07 UTC] mkoppanen@php.net
Sorry, but your problem does not imply a bug in PECL itself.  For a
list of more appropriate places to ask for help using PECL, please
visit http://pecl.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PECL.

<?php
$image_width = 200;
$image_height = 200;
$text = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
                 Mauris lectus mi, mattis non, euismod vel, sagittis nec, ipsum.";
$im = new Imagick();
$im->setBackgroundColor("transparent");
$im->newPseudoImage( $image_width, $image_height, "caption:" . $text );
$im->paintOpaqueImage ("black", "red", 100000);

$im->setImageFormat( "png") ;
header( "Content-Type: image/png" );
echo $im;
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 04:01:33 2024 UTC