|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #58678 fxImage
Submitted: 2009-05-18 10:56 UTC Modified: 2009-06-04 16:05 UTC
From: me at reso dot od dot ua Assigned:
Status: Not a bug Package: imagick (PECL)
PHP Version: 5.2.9 OS: Ubuntu LTS 8.04
Private report: No CVE-ID: None
 [2009-05-18 10:56 UTC] me at reso dot od dot ua
I'm trying to reproduce the example from 
i.e. Dithering with Symbol Patterns

The following command works from the command line: convert 
eyes.gif +matte -colorspace Gray -scale 1600% -negate \
            dpat_symbols.gif   -virtual-pixel tile  -fx 
'u[floor(16*u)+1]' \

Reproduce code:

$img=new Imagick();

$src=new Imagick();    

header("Content-type: image/jpeg");
echo $img;


Expected result:
This should produce something like this:

but only one image from gif sequence i.e. 16x16px is shown.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-05-18 11:28 UTC]

try something like:


$img=new Imagick();

$src=new Imagick();

foreach ($img as $frame) 

header("Content-type: image/jpeg");
echo $img->getImagesBlob(true);

 [2009-05-18 15:15 UTC] me at reso dot od dot ua
Thank you for the reply. Unfortunately this does not work. The 
thing is IM is using gif as a lookup table and the output is 
not intended to be animated. It appears that fxImage("u[0]") 
for instance returns the 16x16 half of eyes.gif instead of 
complete picture.
 [2009-05-22 03:59 UTC] me at reso dot od dot ua
I have tried the similar code with MagickWand API and it works 
 [2009-05-23 07:12 UTC]

can you paste the MagickWand code you are trying?
 [2009-05-23 07:17 UTC] me at reso dot od dot ua
Although it does not produce the same result as in command line, at least it produces the full size picture:


MagickSetImageColorspace($img, MW_GRAYColorspace);
MagickScaleImage($img, 288, 288);

MagickSetImageVirtualPixelMethod($tmp, MW_TileVirtualPixelMethod);
MagickAddImages($img, $tmp);
$img = MagickFxImage($img,"u[floor(15.9999*u)+1]");

header("Content-type: image/png");


Maybe I'm doing something wrong?
 [2009-06-04 16:05 UTC]
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 as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PECL.

Not sure if this is an actual bug or more of a usage issue. Have you tried asking on ImageMagick forums? 

This seems to be quite close to your MagickWand example:


$im = new Imagick('eyes.gif');

$im->resizeImage(288, 288, imagick::FILTER_LANCZOS, 0.2);
$im->setImagePage(288,288, 0, 0);

$tmp = new Imagick('dpat_symbols.gif');

foreach ($tmp as $frame) {
        $im->addImage($frame->fxImage("u[floor(15.9999*u)+1]", -1));

header("Content-type: image/gif");
echo $im->getImagesBlob();
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Aug 07 14:01:26 2020 UTC