php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70980 Function tintimage does not work
Submitted: 2015-11-26 18:43 UTC Modified: 2015-12-05 13:35 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: lee dot traynor at skeptic dot de Assigned: danack (profile)
Status: Closed Package: imagick (PECL)
PHP Version: 5.5.30 OS: Windows XP
Private report: No CVE-ID: None
 [2015-11-26 18:43 UTC] lee dot traynor at skeptic dot de
Description:
------------
---
From manual page: http://www.php.net/imagick.tintimage
---
comparing the results of

convert *input* -fill red -tint 130 *output*

with

$im->tintImage ("red", 130);

The resultant images do not match

Test script:
---------------
$im = new Imagick ("some_file.jpg");
$im->tintImage ("red", 130);
$im->writeImage ("some_file_tinted_red.jpg");

Expected result:
----------------
Image should be tinted red

Actual result:
--------------
Image is darkened only, as if the value "1" had been given to convert after the -tint command.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-12-05 13:35 UTC] danack@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: danack
 [2015-12-05 13:35 UTC] danack@php.net
Thanks for reporting. This is fixed in master and will be released in 3.4.0RC3

Note. The scale is different for Imagick. On the command line, the normal range for the strength or opacity is 0-100. For Imagick the range is 0-255.

i.e. the equivalent of:

convert TintTest.png -fill red -tint 40 tint_red.png

is:

$imagick = new Imagick("./TintTest.png");
$imagick->tintImage ("red", "rgba(102, 102, 102, 1)");
$imagick->setImageFormat('png');
$imagick->writeImage("./TintTest_imagick_40.png");


To use strength values above the normal range, you may need to have ImageMagick compiled with HDRI enabled, as it is possible that pixel colors outside the normal range of 0-255 could be clamped by ImageMagick.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 06:01:30 2024 UTC